Is .value() the proper way to set app-wide constant and how to retrieve it in a controller?
Answer / Mukesh Kumar
Yes, you can use the $injector service's .value() method to set constants at the application level. To retrieve the constant in a controller, inject the $injector service, call its .get() method, and pass the constant's name as an argument.
| Is This Answer Correct ? | 0 Yes | 0 No |
What is package json in angular?
How do components communicate with each other?
What are the advantages of token-based authentication?
What is ng-cloak directive and why we use?
Can we use the open-source closure library with angular?
What is an angular 2 service?
What is ivy rendering engine in angular 7?
Explain the functionality angular.copy() method?
What is scope in angular?
In angular, describe how will you set, get and clear cookies?
Why is mvc used?
Does Angular use the jQuery library?