Skip to content
Snippets Groups Projects
text.component.ts 920 B
Newer Older
  • Learn to ignore specific revisions
  • import { Component } from '@angular/core';
    
    import { TextElement } from '../unit';
    
    import { ElementComponent } from '../element-component.directive';
    
    rhenck's avatar
    rhenck committed
      selector: 'app-text',
    
      template: `
    
    rhenck's avatar
    rhenck committed
          <div [style.width.px]="elementModel.width"
               [style.height.px]="elementModel.height"
               [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' : ''"
               [style.white-space]="'pre-wrap'">
    
              {{elementModel.text}}
    
    export class TextComponent extends ElementComponent {
    
      elementModel!: TextElement;
    }