Given an AngularJS module, there are two functions defined in it, functionA and functionB. How to call functionA from functionB?
app.service('myService', [
function() {
module = {
functionA: function() { ... },
functionB: function() {
// call functionA
}
}
return module;
}
]);
I figured it out. As the function is under the module scope (module = {) it has to be referred with the scope name i.e.
module.functionA