In my angular app i have a module defined in one js file
angular.module('myApp',[])
In another js file I have a base controller defined
angular.model('myApp').controller('baseController',
function($scope){
$scope.var1 = 'foo';
$scope.func1 = function(){
// do something
}
}
)
now based on Can an AngularJS controller inherit from another controller in the same module? I want to create a controller in another js file that inherits from baseController and adds some fields and functions eg
angular.model('myApp').controller('myController',
$injector.invoke(baseController, this, {$scope: $scope});
}
)
But this gives an error as it does not know about baseController. I have tried putting baseController in '' but no help.
Any ideas. Thanks Martin