Thursday, November 5, 2015

AngularJS - What is service method?

Ref:- http://www.tutorialspoint.com/angularjs/angularjs_interview_questions.htm

Using service method, we define a service and then assign method to it. We've also injected an already available service to it.

mainApp.service('CalcService', function(MathService){
   this.square = function(a) { 
      return MathService.multiply(a,a); 
 }
});

No comments:

Post a Comment