When working with two controllers, one as the parent and the other as the child.
<div ng-controller="firstCtrl as first">
<div ng-controller="secondCtrl as second"></div>
</div>
JS:
app.controller('firstCtrl', function() {
this.func = function() {
//implementation
};
});
app.controller('secondCtrl', function() {
this.parent.func(some_data);//this is what needs to be achieved
});
Is there a way to achieve this without relying on a factory or $scope.$parent
?