Probably this is an easy question for advanced angular users, but I did not find this issue somewhere well explained.
So I was restructuring my code, when I realized, I have two controllers in a view, which is not a problem, when controller 'ACtrl' is binded by the $stateProvider and controller 'BCtrl' is binded in the view by ng-controller. But when I try to assign both of them in the $stateProvider like this:
$stateProvider.state('a.view', {
url: "/anurl",
views: {
'menuContent': {
templateUrl: "anUrlToMyTemplates",
controller: 'ACtrl', 'BCtrl'
}
}
});
or that:
$stateProvider.state('a.view', {
url: "/anurl",
views: {
'menuContent': {
templateUrl: "anUrlToMyTemplates",
controller: 'ACtrl',
controller: 'BCtrl'
}
}
});
it won't work.
I know it would be a solution to make the content of the controllers up to one, but controller 'ACtrl' is used somewhere else, too, so I would have to repeat myself somewhere else. How can I solve this...