|
|
@ -2,6 +2,7 @@ import { Directive, ElementRef, OnInit, Renderer2 } from '@angular/core'; |
|
|
|
|
|
|
|
@Directive({ |
|
|
|
selector: '[appCustomButton]', |
|
|
|
exportAs:'customButton', |
|
|
|
}) |
|
|
|
export class CustomButtonDirective implements OnInit { |
|
|
|
constructor(private elRef: ElementRef, private renderer: Renderer2) {} |
|
|
@ -11,4 +12,9 @@ export class CustomButtonDirective implements OnInit { |
|
|
|
this.renderer.setStyle(this.elRef.nativeElement, 'fontSize', '14pt'); |
|
|
|
this.renderer.setStyle(this.elRef.nativeElement, 'fontWeight', 'bold'); |
|
|
|
} |
|
|
|
changeColor(color:string): void{ |
|
|
|
this.renderer.setStyle( |
|
|
|
this.elRef.nativeElement, 'color', color |
|
|
|
); |
|
|
|
} |
|
|
|
} |