What is the purpose of forroot method in angular 4?
Answer / Sukh Beer Singh
The forRoot() method in Angular 4 (actually Angular 2 and up) is used when you need to create and register a service that should be available throughout the entire application, such as a shared service. The forRoot() method typically returns an instance of the service along with metadata about the module it belongs to, which allows Angular to manage the lifecycle of the service properly.
| Is This Answer Correct ? | 0 Yes | 0 No |
What is route params?
Differentiate between ng-Class and ng-Style?
List out the differences between config and run methods in angularjs?
What is ngoninit in angular?
How to enable html5 mode in angular 1.x?
Mention what are the advantages of using angularjs?
How to use styleurls and styles in angular?
What is backend javascript?
What are AngularJS features? 15
What is the use of pipe in rxjs?
What is a decorator in angular?
What is the use of typescript in angular2?