Loading…

What are the difference between @injectable() vs. @inject() in angular 2?

  @Injectable @Inject
1. Aims to set metadata of dependencies to be injected into constructor Tells Angular what parameter must be injected
2. Without it, no dependency can be injected Only needed to inject primitives

Suggest An Answer

No suggestions avaliable!

Latest post from Angular 2 Interview Questions

Ask Question