Problem Statment
I am learning Angular 4 and I have stumble upon a code where @Inject is being used in a constructor and I am
If MAT_DIALOG_DATA is a non-factory/class dependency (like string for your configs), you usually use @Inject.
Also check InjectionToken: https://angular.io/guide/dependency-injection#injectiontoken
One solution to choosing a provider token for non-class dependencies is to define and use an
InjectionToken
Here's a plunker: http://plnkr.co/edit/GAsVdGfeRpASiBEy66Pu?p=preview
if you remove @Inject in these cases you will receive a
Can't resolve all parameters for ComponentName: (?)