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
What is providedin in angular?
Explain uppercase filterangularjs?
Is the jquery library used in angular?
What is linking function?
What are angular js expressions?
Mention some of the most commonly used directives in angularjs application?
How would you pass data from a child component to a parent component?
How do we include css file ins. The component except using styleurls property?
What is cross site script inclusion (xssi)?
Does AngularJS have dependency on jQuery?
What is the use of typescript in angular2?
What is angular base elements?
How to set headers for every request in angular?
What is service? Why use?
What is jit and aot?