2 * Created by rc2122 on 6/1/2017.
4 import { Component, ElementRef, Input, OnInit, OnDestroy } from '@angular/core';
5 import * as $ from 'jquery';
6 import {ButtonsModelMap} from "app/models/button";
10 templateUrl: './modal.component.html',
11 styleUrls:['modal.component.less']
14 export class ModalComponent implements OnInit, OnDestroy {
15 @Input() size: string; 'xl|l|md|sm|xsm'
16 @Input() title: string;
17 @Input() public buttons:ButtonsModelMap;
18 private modalElement: JQuery;
19 private buttonsNames:Array<string>;
21 constructor( el: ElementRef ) {
22 this.modalElement = $(el.nativeElement);
27 this.modalElement.appendTo('body');
29 this.buttonsNames = Object.keys(this.buttons);
34 this.modalElement.remove();
38 this.modalElement.show();
39 $('body').addClass('modal-open');
43 this.modalElement.hide();
44 $('body').removeClass('modal-open');