# All files / src/app/shared/components/back-button back-button.component.ts

93.33% Statements 14/15
70% Branches 7/10
50% Functions 1/2
100% Lines 8/8

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
    1793x
    93x

    93x

    93x
    228x

    228x
    228x
    93x
     import { Location } from '@angular/common';
    import { Component, Input } from '@angular/core';

    import { ActionLabelsI18n } from '../../constants/app.constants';

    @Component({
      selector: 'cd-back-button',
      template: require('./back-button.component.html'),
      styles: []
    })
    export class BackButtonComponent {
      constructor(private location: Location, private actionLabels: ActionLabelsI18n) {}

      @Input() name: string = this.actionLabels.CANCEL;
      @Input() back: Function = () => this.location.back();
    }