]>
Commit | Line | Data |
---|---|---|
8c6781e9 | 1 | import { Component, Input, OnInit } from '@angular/core' |
cd83ea1b C |
2 | |
3 | @Component({ | |
4 | selector: 'my-delete-button', | |
5 | styleUrls: [ './button.component.scss' ], | |
6 | templateUrl: './delete-button.component.html' | |
7 | }) | |
8 | ||
8c6781e9 | 9 | export class DeleteButtonComponent implements OnInit { |
eacb25c4 | 10 | @Input() label: string |
30814423 | 11 | @Input() title: string |
8c6781e9 | 12 | |
8c6781e9 | 13 | ngOnInit () { |
30814423 K |
14 | // <my-delete-button /> No label |
15 | if (this.label === undefined && !this.title) { | |
66357162 | 16 | this.title = $localize`Delete` |
30814423 K |
17 | } |
18 | ||
19 | // <my-delete-button label /> Use default label | |
20 | if (this.label === '') { | |
66357162 | 21 | this.label = $localize`Delete` |
30814423 K |
22 | |
23 | if (!this.title) { | |
24 | this.title = this.label | |
25 | } | |
26 | } | |
60709df5 | 27 | } |
cd83ea1b | 28 | } |