angular2-draggable icon indicating copy to clipboard operation
angular2-draggable copied to clipboard

ngDraggable not working for content loaded with innerHtml angular2+

Open idiotic-intellect opened this issue 4 years ago • 2 comments

I am getting an HTML file from the backend that I am displaying in angular with inner Html in a div tag. In that ngDraggable in HTML file is not recognized, that is not processed by angular as like directive

idiotic-intellect avatar Jan 23 '20 05:01 idiotic-intellect

Angular: <div *ngIf="content" class="content" [innerHTML]="sanitize.bypassSecurityTrustHtml(content)"></div>

Html from backend:

<div class="container" contenteditable="true" id="div0" style="position : relative;">
  <div id="div1" style="position : relative; margin : 2%; height : 554.5px">
    <input class="form-control" id="textbox1" name="textbox1" style="top : 195.21px; left : 297.61px;  position : absolute; width : 20%;" type="text">
    <button ngDraggable class="btn-primary" id="button1" style="top : 367.03px; left : 189.82px;  position : absolute;">Button</button>

  </div>
</div>

In this, on button tag, I am giving ngDraggable that I am no able to drag after loaded to angular from the backend

idiotic-intellect avatar Jan 23 '20 09:01 idiotic-intellect

@xieziyu can u check this

idiotic-intellect avatar Jan 23 '20 10:01 idiotic-intellect