title: Can't resolve all parameters for MatDialogRef angular 4
body: <p>I'm working on Angular 4 and I'm trying to setup material package, and here I'm trying to try dialog, but it doesn't work maybe because of material package I'm not sure.</p>
  
  <p>This is my (dialog.components.ts):</p>
  
  <pre><code>import {Component, OnInit} from '@angular/core';
  import {MatDialogRef} from '@angular/material'
  
  @Component({
      selector: 'app-dialog',
      templateUrl: './dialog.component.html',
      styleUrls: ['./dialog.component.css']
  })
  export class DialogComponent implements OnInit {
  
      public receivedNode: any;
  
      constructor(public dialogRef: MatDialogRef&lt;DialogComponent&gt;) {
      }
  
      ngOnInit() {
      }
  
  }
  </code></pre>
  
  <p>And in my module:</p>
  
  <pre><code>import {MatButtonModule,MatMenuModule,MatToolbarModule,MatIconModule,MatCardModule, MatDialogRef} from '@angular/material';
  
  
   @NgModule({
          imports: [
              CommonModule,
              MatButtonModule,
              MatMenuModule,
              MatToolbarModule,
              MatIconModule,
              MatCardModule,
              RouterModule.forRoot(
                  appRoutes,
                  {enableTracing: true}
              ),
          ],
          declarations: [],
          exports: [
              MatButtonModule,
              MatMenuModule,
              MatToolbarModule,
              MatIconModule,
              MatCardModule
          ],
          entryComponents: [DialogComponent],
          providers: [MatDialogRef]
      })
      export class DialogModule {
      }
  </code></pre>
  
  <p>I got this error:
  <a href="https://i.stack.imgur.com/y1vkh.png" rel="noreferrer"><img src="https://i.stack.imgur.com/y1vkh.png" alt="Uncaught Error: Can&#39;t resolve all parameters for MatDialogRef: (?, ?, ?)."></a></p>
  
  <p>Any ideas?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>My call function:</p>
  
  <pre><code>openPopup(){
          const config = new MatDialogConfig();
          const dialogRef: MatDialogRef&lt;DialogComponent&gt; = this.dialog.open(DialogComponent, config);
  
          dialogRef.componentInstance.receivedNode = "test";
          console.log("test");
      }
  </code></pre>