Tag: DI
-
When to use viewProviders in Angular – Simplified
I have often seen developers are confused about viewProviders property of the @Componnet decorator. This post explains to you about the viewProviders option. The viewProviders defines the set of injectable objects that are visible to its view, DOM children. They are not visible to the content children. At the component level, you can provide a service in two ways: Using the providers array Using the viewProviders array.…