38 lines
940 B
TypeScript
38 lines
940 B
TypeScript
import {Component, Input, input, output} from '@angular/core';
|
|
import { NzButtonModule } from 'ng-zorro-antd/button';
|
|
import { NzModalModule } from 'ng-zorro-antd/modal';
|
|
import {NzIconDirective} from "ng-zorro-antd/icon";
|
|
|
|
@Component({
|
|
selector: 'app-modal-nav',
|
|
imports: [NzButtonModule, NzModalModule, NzIconDirective],
|
|
templateUrl: 'modal-nav.html',
|
|
styleUrls: ['./modal-nav.css'],
|
|
})
|
|
export class ModalNav {
|
|
nameIcon = input.required<string>()
|
|
name = input.required<string>()
|
|
ok = output<void>();
|
|
cancel = output<void>();
|
|
isVisible = false;
|
|
isOkLoading = false;
|
|
|
|
showModal(): void {
|
|
this.isVisible = true;
|
|
}
|
|
|
|
handleOk(): void {
|
|
this.isOkLoading = true;
|
|
setTimeout(() => {
|
|
this.ok.emit();
|
|
this.isOkLoading = false;
|
|
}, 1000);
|
|
}
|
|
|
|
handleCancel(): void {
|
|
this.isVisible = false;
|
|
this.cancel.emit();
|
|
|
|
}
|
|
}
|