What is difference between config() and run() method in AngularJS?
Answer / chaitanya
Configuration block – This block is executed during the provider registration and configuration phase. Only providers and constants can be injected into configuration blocks. This block is used to inject module wise configuration settings to prevent accidental instantiation of services before they have been fully configured. This block is created using config() method.
Run block – This block is executed after the configuration block. It is used to inject instances and constants. This block is created using run() method. This method is like as main method in C or C++. The run block is a great place to put event handlers that need to be executed at the root level for the application. For example, authentication handlers.
| Is This Answer Correct ? | 54 Yes | 3 No |
What is in node js?
Difference between angularjs and javascript expressions?
What is angularjs prefixes $ and $$?
What is angular directive? Explain in detail?
What is interceptor in angular?
What is the key difference between angular expressions and javascript expressions?
Is angular or react easier to learn?
Tell me does Angular use the jQuery library?
What is angular cookie?
What is *ngfor directive used for?
How to use styleurls and styles in angular 2?
What is provider in angularjs?