import { Component, Input } from '@angular/core'; import { NzModalSubject, NzModalService, NzMessageService } from 'ng-zorro-antd'; import { ModalHelper } from '@shared/helper/modal.helper'; @Component({ selector: 'app-model-custom', template: `

From Custom Componetn!

Input Data: {{name}}

submodal: show

Popconfirm 气泡确认框: 删除

` }) export class ModelCustomComponent { @Input() name: string; constructor( private modalHelper: ModalHelper, private model: NzModalService, private msg: NzMessageService, private subject: NzModalSubject) {} show() { this.modalHelper .open(ModelCustomComponent, { name: 'From Submodal Data' }, 'sm', { zIndex: 1001 // https://github.com/NG-ZORRO/ng-zorro-antd/issues/317 }) .subscribe(result => this.msg.info(`subscribe sub status: ${JSON.stringify(result)}`)); } ok() { this.subject.next(`new time: ${+new Date}`); this.cancel(); } cancel() { this.subject.destroy(); } }