1
|
import {Component, ViewEncapsulation, ComponentRef, ElementRef, Input, EventEmitter, Output} from '@angular/core';
|
2
|
|
3
|
@Component({
|
4
|
selector: 'modal-loading',
|
5
|
template: `
|
6
|
<!--uk-modal="center:true"-->
|
7
|
<div [class]="(!isOpen)?'uk-modal ':'uk-modal uk-open uk-animation-fade'" [open]="!isOpen" tabindex="-1" role="dialog" >
|
8
|
<div class="uk-modal-dialog" role="">
|
9
|
<!--div class="modal-content"-->
|
10
|
|
11
|
<div class="uk-modal-body">
|
12
|
<div >
|
13
|
<h3 class="text-center" >{{message}}</h3>
|
14
|
<div class="uk-modal-spinner"></div>
|
15
|
</div>
|
16
|
</div>
|
17
|
|
18
|
</div>
|
19
|
<!--/div-->
|
20
|
</div>
|
21
|
<!--div class="uk-modal uk-open" aria-hidden="false" style="display: block; overflow-y: scroll;">
|
22
|
<div class="uk-modal-dialog" tabindex="">
|
23
|
<div class="uk-modal-spinner"></div>
|
24
|
</div>
|
25
|
</div-->
|
26
|
`,
|
27
|
encapsulation: ViewEncapsulation.None,
|
28
|
})
|
29
|
/**
|
30
|
* API to an open alert window.
|
31
|
*/
|
32
|
export class ModalLoading{
|
33
|
|
34
|
@Input() public message:string ="Loading";
|
35
|
|
36
|
/**
|
37
|
* if the value is true alert will be visible or else it will be hidden.
|
38
|
*/
|
39
|
public isOpen:boolean=false;
|
40
|
/**
|
41
|
* Emitted when a ok button was clicked
|
42
|
* or when Ok method is called.
|
43
|
*/
|
44
|
@Output() public alertOutput:EventEmitter<any> = new EventEmitter();
|
45
|
constructor( public _elementRef: ElementRef){}
|
46
|
/**
|
47
|
* Opens a alert window creating backdrop.
|
48
|
*/
|
49
|
open(){
|
50
|
this.isOpen= true;
|
51
|
}
|
52
|
|
53
|
close(){
|
54
|
this.isOpen = false;
|
55
|
}
|
56
|
}
|