Advertisement
Guest User

Untitled

a guest
Jul 5th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. export class ModalComponent implements OnInit {
  2.  
  3.   @Input('config') config: ModalConfiguration;
  4.   @Input('isOpen') isOpen: string;
  5.   @Output('closeModal') closeModalEvent: EventEmitter<Boolean> = new EventEmitter<Boolean>();
  6.  
  7.   constructor() {}
  8.  
  9.   ngOnInit() {
  10.     this.setInitialConfiguration();
  11.   }
  12.  
  13.   setInitialConfiguration() {
  14.     if(this.config.closeIcon === undefined) this.config.closeIcon = true;
  15.   }
  16.  
  17.   closeModal(): void {
  18.     this.closeModalEvent.emit(false);
  19.     this.isOpen = 'swipeUp';
  20.   }
  21.  
  22. }
  23.  
  24. export interface ModalConfiguration {
  25.   title?: String;
  26.   message?: String;
  27.   confirmationButton: Boolean;
  28.   closeButton: Boolean;
  29.   closeIcon?: Boolean;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement