1 import { Component, Input, OnInit } from '@angular/core'
2 import { I18n } from '@ngx-translate/i18n-polyfill'
5 selector: 'my-edit-button',
6 styleUrls: [ './button.component.scss' ],
7 templateUrl: './edit-button.component.html'
10 export class EditButtonComponent implements OnInit {
11 @Input() label: string
12 @Input() title: string
13 @Input() routerLink: string[] | string = []
15 constructor (private i18n: I18n) { }
18 // <my-edit-button /> No label
19 if (this.label === undefined && !this.title) {
20 this.title = this.i18n('Update')
23 // <my-edit-button label /> Use default label
24 if (this.label === '') {
25 this.label = this.i18n('Update')
28 this.title = this.label