Skip to content
Snippets Groups Projects
button.component.ts 988 B
Newer Older
  • Learn to ignore specific revisions
  • import { Component, EventEmitter, Output } from '@angular/core';
    
    import { ElementComponent } from '../element-component.directive';
    
    import { ButtonElement } from '../unit';
    
    
    @Component({
      selector: 'app-button',
      template: `
    
                (focusin)="onFocusin.emit()"
    
                [style.width.%]="100"
                [style.height.%]="100"
    
    rhenck's avatar
    rhenck committed
                [style.background-color]="elementModel.backgroundColor"
                [style.color]="elementModel.fontColor"
                [style.font-family]="elementModel.font"
                [style.font-size.px]="elementModel.fontSize"
                [style.font-weight]="elementModel.bold ? 'bold' : ''"
                [style.font-style]="elementModel.italic ? 'italic' : ''"
                [style.text-decoration]="elementModel.underline ? 'underline' : ''">
    
          {{elementModel.label}}
    
    export class ButtonComponent extends ElementComponent {
    
      @Output() onFocusin = new EventEmitter();
    
      elementModel!: ButtonElement;
    }