美文网首页
对话框 Dialog 的问题

对话框 Dialog 的问题

作者: 晨曦Bai | 来源:发表于2019-12-23 15:37 被阅读0次

: 弹窗组件是个组件,同时也是一个服务,必须写入 entryComponent 中, 否则不能正常显示

创建弹窗组件 new-project , 所在模块为 project.module.ts
project.module.ts 的 new-porject 组件导入应该写成:

import { NewProjectComponent } from './new-project/new-project.component';

@NgModule({
  imports: [
    SharedModule
  ],
` \\ declarations  要声明 NewProjectComponent`
  declarations: [ProjectComponent, NewProjectComponent],  
  providers: [ProjectService],
`\\ entryComponents  也要声明 NewProjectComponent`
  entryComponents:[
    NewProjectComponent    //
  ]
})

参考: https://www.cnblogs.com/hibiscus-ben/p/10201471.html

相关文章

网友评论

      本文标题:对话框 Dialog 的问题

      本文链接:https://www.haomeiwen.com/subject/qvgznctx.html