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

100% Statements 12/12
66.67% Branches 2/3
100% Functions 2/2
100% Lines 9/9

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
    2993x

    93x

    93x

    93x

    93x

    93x

    1x

    2x

    93x
     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();
      }
    }