I have included the angular js in my project and written a function name "hasOrganizationPermission" like below . And I am calling this function from some other project but this project does not contains any angular code or reference.
Note: We all know that, there are lots of questions and answers available in StackOverflow for this question but all answers are given by using angular js reference only. I am asking without angular help, how we can call a angular js function from pure Javascript
app.factory('$user', function ($http, $cookies, $q, $injector, $authMgr) {
function PlatformUser(sessionUser) {
var user = this;
user.hasOrganizationPermission = function (action, organizationId) {
if (!action) return false;
var actionId = typeof action == 'object' ? action.id : action;
//Some Logics & return....
};
}
});
Here I want to call the function "hasOrganizationPermission" from Jquery or Javascript without using any angular reference. So how to call the function from pure java script? Is it possible to call a angular js function from pure javascript ?