Skip to content
Snippets Groups Projects
frame.component.ts 890 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 'common/models/elements/frame/frame';
    
    rhenck's avatar
    rhenck committed
    
    @Component({
    
      selector: 'aspect-frame',
    
    rhenck's avatar
    rhenck committed
      template: `
    
        <div [style.width]="'calc(100% - ' + (elementModel.styling.borderWidth * 2) + 'px)'"
             [style.height]="'calc(100% - ' + (elementModel.styling.borderWidth * 2) + 'px)'"
             [style.border-style]="elementModel.styling.borderStyle"
             [style.border-width.px]="elementModel.styling.borderWidth"
             [style.border-color]="elementModel.styling.borderColor"
             [style.border-radius.px]="elementModel.styling.borderRadius"
             [style.background-color]="elementModel.styling.backgroundColor">
    
    rhenck's avatar
    rhenck committed
      `
    })
    
    rhenck's avatar
    rhenck committed
    export class FrameComponent extends ElementComponent {
    
    rhenck's avatar
    rhenck committed
      @Input() elementModel!: FrameElement;
    }