What is the difference between declarations, import and providers in NgModule?

897    Asked by Rahulverma in Python , Asked on Nov 13, 2019
Answered by Arun Singh

Imports makes the traded declarations of different modules accessible in the present module

Declarations are to make mandates (counting segments and funnels) from the present module accessible to different orders in the present module. Selectors of mandates, parts or channels are possibly coordinated against the HTML on the off chance that they are announced or imported.

Providers are to make administrations and qualities known to DI. They are added to the root degree and they are infused to different administrations or mandates that have them as reliance.

An extraordinary case for providers is sluggish stacked modules that get their own youngster injector. 'Providers' of a lethargic stacked module are just given to this languid stacked module of course (not the entire application for what it's worth with different modules).



Your Answer

Interviews

Parent Categories