Skip to content
Snippets Groups Projects
dropdown.component.ts 1.24 KiB
Newer Older
import { Component } from '@angular/core';
import { CanvasElementComponent } from '../canvas-element-component.directive';

@Component({
  selector: 'app-dropdown',
  template: `
rhenck's avatar
rhenck committed
      <mat-form-field *ngIf="draggable"
                      cdkDrag [cdkDragData]="this"
                      appearance="fill"
                      (click)="click($event)"
                      [ngStyle]="style">
          <mat-label>{{$any(elementModel).label}}</mat-label>
          <mat-select>
              <mat-option *ngFor="let option of $any(elementModel).options" [value]="option">
                  {{option}}
              </mat-option>
          </mat-select>
      </mat-form-field>
rhenck's avatar
rhenck committed
      <mat-form-field *ngIf="!draggable"
                      appearance="fill"
                      (click)="click($event)"
                      [ngStyle]="style">
          <mat-label>{{$any(elementModel).label}}</mat-label>
          <mat-select>
              <mat-option *ngFor="let option of $any(elementModel).options" [value]="option">
                  {{option}}
              </mat-option>
          </mat-select>
      </mat-form-field>
  `,
  styles: [
    'mat-form-field {position: absolute}'
  ]
})
export class DropdownComponent extends CanvasElementComponent { }