I'm following an exercise in a book, so I don't know if I'm doing any mistake. I have two controllers both with a function with same name:
app.controller('externalController', ['$scope', function(scope){
scope.aFunction(){
//Some code...
};
}]);
app.controller('innerController', ['$scope', function(s){
s.aFunction(){
//Some code...
};
}]);
In the book, the function of the external controller is calles in this way:
<div ng-controller="externalController as Ext">
<div ng-controller="innerController">
<button ng-click="Ext.aFunction()>Button</button>
</div>
</div>
this doesn't work for me, can anyone tell me if I'm doing any mistake or if there's something wrong in the code? Thanks a lot. mauro