blob: 225f739db53e4b11f743c7dc211d103d7058bccc (
plain)
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
29
30
31
32
33
34
35
36
|
import { Component, OnInit, Output, EventEmitter, Input } from '@angular/core';
@Component({
selector: 'rdp-icon-button',
styleUrls: ['./rdp-icon-button.component.css'],
template: `
<button type="button" class="btn btn-primary" (click)="emitClickEvent()" [disabled]="isDisabled">
<i class="{{icon}}"></i>
{{text}}
</button>
`
})
export class RdpIconButtonComponent implements OnInit {
@Output() rdpClick = new EventEmitter<any>();
@Input() isDisabled:boolean = false;
@Input() text = "Button Name";
@Input() icon : string;
constructor() { }
ngOnInit() {
}
emitClickEvent(){
this.rdpClick.emit();
}
// Example usage: ( Needs Testing: )
// ==================================
// <rdp-button [text]="'SUBMIT'" (rdpClick)="editMyFiles(Object)" [icon]="'icon ion-md-person-add'" [isDisabled]=true></rdp-button>
// Note: Ensure the text and icon strings are enslosed in this formt : "' <<YOUR TEXT>> '"
}
|