Question: Explain dependency injection in Angular.Answer: Dependency injection is a design pattern in which a class receives its dependencies from external sources rather than creating them itself. In Angular, the DI system provides and injects the dependencies into the components, services, etc.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: