Project

General

Profile

1
import {Component, ViewEncapsulation, ComponentRef, ElementRef, Input, EventEmitter, Output} from '@angular/core';
2

    
3
@Component({
4
  selector: 'modal-loading',
5
  template: `
6
  <div [class]="(!isOpen)?'uk-modal ':'uk-modal uk-open uk-animation-fade'"   [open]="!isOpen"   data-uk-modal="{center:true}" tabindex="-1" role="dialog" >
7
    <div class="uk-modal-dialog" role="">
8
      <div class="modal-content">
9

    
10
        <div class="modal-body">
11
          <div >
12
          <h3 class="text-center" >{{message}}</h3>
13
          <div class="uk-modal-spinner"></div>
14
          </div>
15
        </div>
16

    
17
      </div>
18
    </div>
19
  </div>
20
  <!--div   class="uk-modal uk-open" aria-hidden="false" style="display: block; overflow-y: scroll;">
21
                            <div class="uk-modal-dialog" tabindex="">
22
                                <div class="uk-modal-spinner"></div>
23
                            </div>
24
                        </div-->
25
  `,
26
  encapsulation: ViewEncapsulation.None,
27
})
28
/**
29
  * API to an open alert window.
30
  */
31
export class ModalLoading{
32

    
33
@Input() public message:string ="Loading";
34

    
35
  /**
36
    * if the value is true alert will be visible or else it will be hidden.
37
    */
38
  public isOpen:boolean=false;
39
  /**
40
    * Emitted when a ok button was clicked
41
    * or when Ok method is called.
42
    */
43
  @Output() public alertOutput:EventEmitter<any> = new EventEmitter();
44
  constructor( public _elementRef: ElementRef){}
45
  /**
46
       * Opens a alert window creating backdrop.
47
       */
48
  open(){
49
    this.isOpen= true;
50
  }
51

    
52
  close(){
53
    this.isOpen = false;
54
  }
55
}
(3-3/8)