InterviewSolution
| 1. |
What is the provider in Angular? |
|
Answer» In Angular dependency, INJECTION is used to INJECT the dependencies of services. A Provider works as an instructor for the dependency injection system to RESOLVE the dependencies. When you CREATE any SERVICE, it comes with default @Injectable decorator that contains a default property 'providedIn,' which establishes the provider for service. Example@Injectable({ You can inject the services in the root or particular module as well, and you can limit the scope of service to a particular component by using component providers. @Component({
|
|