The other day I've had to refactor a piece of angular code. Unfortunately, the original code was written a long time ago and has some issues like having $scope in controllers and a rather large number of unused variables. changing the $scope to this is a very time-consuming