Which method can be used to define a service and its method?



Which method can be used to define a service and its method?..

Answer / Joginder

A service in AngularJS can be defined using the `angular.module('myApp').service('MyService', function() { ... });` syntax. Services often contain functions or methods that perform specific tasks and are shared across multiple controllers.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More AngularJS Interview Questions

What are the key features of angular.js?

1 Answers  


What are the difference between component and directive in angular 2?

1 Answers  


What is ngmodule in angular?

1 Answers  


What is router outlet in angular?

1 Answers  


What is modules?

1 Answers  


What are angular templates?

1 Answers  


What is lazy loading in angular?

1 Answers  


What is difference between component and module in angular?

1 Answers  


How does scope inheritance work in angularjs?

1 Answers  


Does angular js depends on jquery library?

1 Answers  


What is injector bubbling?

1 Answers  


List out the differences between activatedroute and routerstate, with reference to angular 2.

1 Answers  


Categories