Angular 4: When and why is @Inject is used in constructor?
问题 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 not able to figure out why... Code and Source I am using Angular 4 Material Code Source: https://material.angular.io/components/dialog/overview In the code, they are injecting MAT_DIALOG_DATA constructor(public dialogRef: MatDialogRef<DialogOverviewExampleDialog>, @Inject(MAT_DIALOG_DATA) public data: any ) { } Can anyone please elaborate what does it mean and when