Open JEIK08 opened 3 years ago
Experiencing the same here.
If there is no title set initially, I can update the title once with updateConfig
But once a title is set it cannot be updated any more...
+1
+1
Hello,
Same problem, but solved using a template.
import { Component } from '@angular/core';
@Component({ selector: 'nz-demo-modal-basic', template: ` <button nz-button [nzType]="'primary'" (click)="showModal()">Show Modal <nz-modal [(nzVisible)]="isVisible" [nzTitle]="tplHeader" (nzOnCancel)="handleCancel()" (nzOnOk)="handleOk()"> <ng-container *nzModalContent>
Content one
<p>Content two</p>
<p>Content three</p>
<button nz-button nzType="primary" (click)="Title=Title=='Changed' ? 'Title' : 'Changed'">Change Title</button>
</ng-container>
</nz-modal>
<ng-template #tplHeader>{{Title}}</ng-template>
` }) export class NzDemoModalBasicComponent { isVisible = false; Title = 'First Title';
constructor() {}
showModal(): void { this.isVisible = true; }
handleOk(): void { console.log('Button ok clicked!'); this.isVisible = false; }
handleCancel(): void { console.log('Button cancel clicked!'); this.isVisible = false; } }
same
Reproduction link
Example
Steps to reproduce
Use the NzModalService to
create
a custom modal, theNzModalRef
is injected to the custom modal component, the injected dependency is used to update the modal configurations but the title of the modal (nzTitle
) is not being updated.What is expected?
The title of the modal changes to the new one
What is actually happening?
The title of the modal stay without changes