What is difference between config() and run() method in AngularJS?
Answer Posted / 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 |
Post New Answer View All Answers
Compare the features of AngularJS and jQuery?
Is angular a good career?
What is params in angularjs?
What is two way data binding angularjs?
Ln component and service which logic that we have to write?
What are the advantages of using angular 2 over angular 1?
What are differences between components and directives?
How to create custom directives?
What is content projection in angular?
What is if-else-and-then conditions in angular4?
What is two-way bindings?
How to use multiple ng-app within a page in angularjs?
What is component in angular?
List some cons or disadvantages of using angularjs?
What is default scope in a angularjs directive?