Skip to content
Snippets Groups Projects
frame.component.ts 874 B
Newer Older
  • Learn to ignore specific revisions
  • rhenck's avatar
    rhenck committed
    import { Component, Input } from '@angular/core';
    
    rhenck's avatar
    rhenck committed
    import { ElementComponent } from '../../directives/element-component.directive';
    
    import { FrameElement } from '../../interfaces/elements';
    
    rhenck's avatar
    rhenck committed
    
    @Component({
    
      selector: 'aspect-frame',
    
    rhenck's avatar
    rhenck committed
      template: `
    
        <div [style.width]="'calc(100% - ' + (elementModel.styles.borderWidth * 2) + 'px)'"
             [style.height]="'calc(100% - ' + (elementModel.styles.borderWidth * 2) + 'px)'"
    
    rhenck's avatar
    rhenck committed
             [style.border-style]="elementModel.styles.borderStyle"
             [style.border-width.px]="elementModel.styles.borderWidth"
             [style.border-color]="elementModel.styles.borderColor"
             [style.border-radius.px]="elementModel.styles.borderRadius"
             [style.background-color]="elementModel.styles.backgroundColor">
    
    rhenck's avatar
    rhenck committed
      `
    })
    
    rhenck's avatar
    rhenck committed
    export class FrameComponent extends ElementComponent {
    
    rhenck's avatar
    rhenck committed
      @Input() elementModel!: FrameElement;
    }