Advertisement
Guest User

Untitled

a guest
Aug 19th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. onSubmit(i:number) {
  2. console.log('editing '+i+' new val:'+this.editval);
  3. if(this.editval.length>0)
  4. this.strtransforms[i]=this.editval; //update cell
  5. else
  6. alert('cant add empty transform')
  7.  
  8. console.log('transforms: '+JSON.stringify(this.strtransforms))
  9. this.strtransforms.push("click me")
  10. console.log('transforms: '+JSON.stringify(this.strtransforms))
  11. }
  12.  
  13. <div *ngIf="!loading$">
  14. <div cdkDropList class="example-list" (cdkDropListDropped)="drop($event)">
  15. <div class="example-box" *ngFor="let s of strtransforms;index as i" cdkDrag
  16. [contentEditable]="true" (contextmenu)="rclick(i)"
  17. (input)="editval = $event.target.innerText">{{s}}
  18. <fa-icon [icon]="['fas', 'coffee']" (click)="onSubmit(i)"></fa-icon>
  19. </div>
  20. </div>
  21. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement