Angular2 material dialog has issues - Did you add it to @NgModule.entryComponents?

前端 未结 11 2283
隐瞒了意图╮
隐瞒了意图╮ 2020-12-04 06:37

I am trying to follow the docs on https://material.angular.io/components/component/dialog but I cannot understand why it has the below issue?

I added the below on my

11条回答
  •  星月不相逢
    2020-12-04 06:56

    You must add it to entryComponents, as specified in the docs.

    @NgModule({
      imports: [
        // ...
      ],
      entryComponents: [
        DialogInvokingComponent, 
        DialogResultExampleDialog
      ],
      declarations: [
        DialogInvokingComponent,   
        DialogResultExampleDialog
      ],
      // ...
    })
    

    Here is a full example for an app module file with a dialog defined as entryComponents.

提交回复
热议问题