adspace
Answer Posted / 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 |
Post New Answer View All Answers
How can primeng be used with angular2?
How to get and log an error in angular 4?
Angularjs dependency injection of value inside of the module.config?
What is the latest angular?
What is the latest version of angular?
What is a dynamic route in angularjs and how do you implement it?
How to use primeng in angular 4?
Give the example of angularjs strings?
How to enable html5 mode in angular 1.x?
How to implement a datagrid table with angular 2 and primeng?
How an object or function can get a hold of its dependencies?
Which version you are using js?
How to create angularjs filter which outputs html?