File

src/app/shared/components/back-button/back-button.component.ts

Metadata

selector cd-back-button
styleUrls ./back-button.component.scss
templateUrl ./back-button.component.html

Index

Inputs

Constructor

constructor(location: Location, actionLabels: ActionLabelsI18n)
Parameters :
Name Type Optional
location Location No
actionLabels ActionLabelsI18n No

Inputs

back
Type : Function
Default value : () => this.location.back()
name
Type : string
Default value : this.actionLabels.CANCEL
import { Location } from '@angular/common';
import { Component, Input } from '@angular/core';

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

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

  @Input() name: string = this.actionLabels.CANCEL;
  @Input() back: Function = () => this.location.back();
}
 
<button class="btn btn-sm btn-default tc_backButton"
        (click)="back()"
        type="button">
  {{ name }}
</button>

./back-button.component.scss

Legend
Html element
Component
Html element with directive

result-matching ""

    No results matching ""