Angular 8 Interview Questions and Answers
Question: How does dependency injection work in Angular?Answer: Dependency injection in Angular works by providing dependencies (services or values) to a component or other Angular construct through their constructor. Angular's DI system takes care of injecting the required dependencies when creating an instance of the component or service.Example:
|
Save For Revision
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Is it helpful? Yes No
Most helpful rated by users: