After half a year I think I understand completely what's going on.
As it is pointed out in a comment to this post, the simplest answer is services.
In the most optimal case, all your scope variables are values gathered from a factory/service. Still, you might want to use the exact same controller with one extra function: $scope.someFunction(){}, and keep the rest. In this case, you do have a 'thin' controller logic, which is the desirable controller design - but may still end up a hundred or more lines of code. You don't want that being duplicated in an other controller, just because you need some extra controller logic (like $scope.someFunction() )
What do you do then?
The answer is this:
- Make sure that you did everything in order to solve the situation with factories
if you are abolutely certain you did, go for the controller injection:
.controller('childController', function ($scope, $controller) {
'use strict';
$controller('parentController', {$scope: $scope});
$scope.someFunction=function(){}
})
It's that simple. -- again, usually, things can be solved with factories..
Hope you find this useful ;)