mirror of https://github.com/abpframework/abp
parent
33c46b5ada
commit
9651909769
@ -0,0 +1,16 @@
|
||||
import { Directive, HostListener, Optional } from '@angular/core';
|
||||
import { ModalComponent } from './modal.component';
|
||||
|
||||
@Directive({ selector: '[abpClose]' })
|
||||
export class ModalCloseDirective {
|
||||
constructor(@Optional() private modal: ModalComponent) {
|
||||
if (!modal) {
|
||||
console.error('Please use abpClose within an abp-modal');
|
||||
}
|
||||
}
|
||||
|
||||
@HostListener('click')
|
||||
onClick() {
|
||||
this.modal?.close();
|
||||
}
|
||||
}
|
||||
Loading…
Reference in new issue