I have an angular function in my controller and I want to call an external javascript function, this won't work and I'm not sure what I'm missing:
$scope.addSubscription = function(){
var id = $scope.userId;
var name = Exec.UserService.fetch(id);
$scope.user.push({id:id, name:name});
}
My external javascript code looks something like this:
var Exec = (function() {
"use strict";
return {
EntityManager: (function(){
// some code here
}());
UserService: (function(){
return {
fetch: function(id){
// some code here
return 'something';
},
modify: function(id, status){
// some code here
}
};
}())
} // end of outer return
}()); // end of Exec