How can I use scope change event in services in angularJs -
I have a controller and a service, but now I want my controller code to be moved to the services so that it is again : Can be made usable. But the problem I am experiencing here is that my controller is using the $ scope service, which means that my code is dependent on the $ diameter event. If I move my code into service, then how can I change this $ scope event now?
I do not know that this is the most effective way, but you pass the $ radius as the function parameter can do.
Controller:
MyService.aMethod ($ scope, other parameters);
Service:
this.aMethod = function (scope, other parameters) {scope.result = otherParameter * 10; }
Comments
Post a Comment