All files / src/app/tasks/kanban-card kanban-card.component.ts

90% Statements 9/10
100% Branches 0/0
75% Functions 3/4
87.5% Lines 7/8
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 351x 1x                                 1x   1x           1x     1x       1x  
import { Component, OnInit, Input, HostBinding } from '@angular/core';
import { KanbanCard } from '../model/kanban-card';
 
@Component({
  selector: 'mwb-kanban-card',
  template: `
    <p class="card" draggable="true" (dragstart)="dragStart($event)" id="{{card?.id}}" >
      #{{card?.id}} - {{card?.description}}
    </p>
  `,
  styles: [`
    p {
      background: white;
      margin: 0 0 6px 0;
      padding: 6px 6px 2px 8px;
    }
  `]
})
export class KanbanCardComponent implements OnInit {
 
  @Input() card: KanbanCard;
 
  // @HostBinding('attr.draggable') true;
 
  constructor() { }
 
  ngOnInit() {
  }
 
  dragStart(ev) {
    ev.dataTransfer.setData('text', ev.target.id);
  }
 
}