“No provider for MdDialogRef!”
Suppose I have this component: @Component({ selector: 'pizza-dialog', template: ` <h1 md-dialog-title>Would you like to order pizza?</h1> <md-dialog-actions> <button (click)="dialogRef.close('yes')">Yes</button> <button md-dialog-close>No</button> </md-dialog-actions> ` }) export class PizzaDialog { constructor(public dialogRef: MdDialogRef<PizzaDialog>) { } } I've already imported MdDialog into my app module: @NgModule({ imports: [ BrowserModule, MaterialModule.forRoot(), MdDialogModule.forRoot(), ], ... }) Why would I get this error? No provider for MdDialogRef! You may have tried to use