All files / src/app/shared/components/modal modal.component.ts

100% Statements 13/13
83.33% Branches 5/6
100% Functions 3/3
100% Lines 10/10

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 2999x   99x             99x   99x           99x       99x 2x 1x   2x   99x  
import { Component, EventEmitter, Input, Output } from '@angular/core';
 
import { BsModalRef } from 'ngx-bootstrap/modal';
 
@Component({
  selector: 'cd-modal',
  template: require('./modal.component.html'),
  styles: []
})
export class ModalComponent {
  @Input()
  modalRef: BsModalRef;
 
  /**
   * Should be a function that is triggered when the modal is hidden.
   */
  @Output()
  hide = new EventEmitter();
 
  constructor() {}
 
  close() {
    if (this.modalRef) {
      this.modalRef.hide();
    }
    this.hide.emit();
  }
}