mirror of https://github.com/abpframework/abp.git
3 changed files with 19 additions and 0 deletions
@ -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