import {Component, input, Input, output} from '@angular/core'; import {NzModalComponent} from "ng-zorro-antd/modal"; import {NzButtonComponent} from "ng-zorro-antd/button"; @Component({ selector: 'app-modal-button', imports: [ NzModalComponent, NzButtonComponent, ], templateUrl: './modal-button.html', styleUrl: './modal-button.css', }) export class ModalButton { name = input.required() type = input<"primary" | "default" | "dashed" | "link" | "text">() ok = output(); cancel = output(); isVisible = false; isOkLoading = false; showModal(): void { this.isVisible = true; } handleOk(): void { this.isOkLoading = true; setTimeout(() => { this.ok.emit(); this.isVisible = false; this.isOkLoading = false; }, 1000); } handleCancel(): void { this.cancel.emit(); this.isVisible = false; } }