Hot to call my own component inside modal Angular 12 和 NG Zorro

Hot to call my own component inside modal Angular 12 and NGZorro

我想在nzmodal中调用我自己的组件。我试过这个:

<nz-modal
  [(nzVisible)]="isVisible"
  nzTitle="Create relation"
  (nzOnCancel)="handleCancel()"
  (nzOnOk)="handleOk()">

  <app-label-relation-create>
  </app-label-relation-create>
</nz-modal>

内部标签关系创建我有表格。

我在路由模块中添加了一些引用吗?或者,有更简单的方法吗?

您可以使用 nzContent API、nzTitle API 和 nzFooter API。他们接受 templateRefstring 作为输入。使用 templateRef 将解决您的问题。