36 lines
813 B
TypeScript
36 lines
813 B
TypeScript
import {Component, input} from '@angular/core';
|
|
import {NzModalComponent} from "ng-zorro-antd/modal";
|
|
import {NzIconDirective} from "ng-zorro-antd/icon";
|
|
|
|
@Component({
|
|
selector: 'app-modal-icon',
|
|
imports: [
|
|
NzModalComponent,
|
|
NzIconDirective
|
|
],
|
|
templateUrl: './modal-icon.html',
|
|
styleUrl: './modal-icon.css',
|
|
})
|
|
export class ModalIcon {
|
|
icon = input.required<string>()
|
|
name = input.required<string>();
|
|
isVisible = false;
|
|
isOkLoading = false;
|
|
|
|
showModal(): void {
|
|
this.isVisible = true;
|
|
}
|
|
|
|
handleOk(): void {
|
|
this.isOkLoading = true;
|
|
setTimeout(() => {
|
|
this.isVisible = false;
|
|
this.isOkLoading = false;
|
|
}, 1000); // 1 secondes
|
|
}
|
|
|
|
handleCancel(): void {
|
|
this.isVisible = false;
|
|
}
|
|
}
|