Skip to content
Snippets Groups Projects
image.component.ts 588 B
Newer Older
  • Learn to ignore specific revisions
  • import { Component } from '@angular/core';
    
    import { ElementComponent } from '../element-component.directive';
    
    rhenck's avatar
    rhenck committed
    import { ImageElement } from '../classes/imageElement';
    
    
    @Component({
      selector: 'app-image',
      template: `
    
        <div [style.height.%]="100"
             [style.width.%]="100">
    
          <img [src]="elementModel.src | safeResourceUrl"
    
    jojohoch's avatar
    jojohoch committed
               alt="Image Placeholder"
    
               [style.object-fit]="'contain'"
               [style.height.%]="100"
    
    jojohoch's avatar
    jojohoch committed
               [style.width.%]="100">
    
    export class ImageComponent extends ElementComponent {
    
      elementModel!: ImageElement;
    }