title: Angular 4: When and why is @Inject is used in constructor?
body: <p><strong>Problem Statment</strong></p>
  
  <p>I am learning Angular 4 and I have stumble upon a code where <code>@Inject</code> is being used in a <code>constructor</code> and I am not able to figure out why...</p>
  
  <p><strong>Code and Source</strong></p>
  
  <p>I am using Angular 4 Material</p>
  
  <p><em>Code Source:</em> <a href="https://material.angular.io/components/dialog/overview" rel="noreferrer">https://material.angular.io/components/dialog/overview</a></p>
  
  <p>In the code, they are injecting <code>MAT_DIALOG_DATA</code></p>
  
  <pre><code>constructor(public dialogRef: MatDialogRef&lt;DialogOverviewExampleDialog&gt;,
               @Inject(MAT_DIALOG_DATA) public data: any
             ) { }
  </code></pre>
  
  <p>Can anyone please elaborate what does it mean and when/where should we do this?</p>