1.

What Is Service Method?

Answer»

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); 
}
});

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); 
}
});



Discussion

No Comment Found