【问题标题】:Multiple nebular dialogs using ng-template使用 ng-template 的多个星云对话框
【发布时间】:2020-11-10 17:53:43
【问题描述】:

有人可以告诉我是否有可能使用 ng-template 有多个 nbDialog 还是我必须使用组件?

任何帮助都会很棒,因为我尝试了各种方法都无济于事,并且在文档上看不到任何内容。

myComponent.ts

openQuestions(dialog: TemplateRef<any>) {
    this.dialogService.open(dialog, { context: `data to pass to dialog.` })
  }

myTemplate.html

////////页面代码放在这里//////

<ng-template  #dialog let-data let-ref="dialogRef" 
[formGroup]="addDailyCheckEquipment">
<- form to be added here ->
</ng-template>

【问题讨论】:

    标签: angular nebular


    【解决方案1】:

    想通了

    要选择要打开的模板,您必须在调用函数时将模板 ID 作为参数添加。

    <button nbButton status="info" fullWidth (click)="open(TEMPLATE NAME HERE WITHOUT QUOTATION MARKS)">add questions</button>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-06-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-05
      • 1970-01-01
      相关资源
      最近更新 更多