Yassine Yassine - 11 days ago 6
AngularJS Question

ng-model doesn't work when dragging and dropping an element

ng-model doesn't work when I drag and copy an input box, here is my code :

<input type="text" ng-model="test" draggable item="items" id="1">
{{test}}

<!--destination -->
<md-content class="bin" drop="handleDrop" droppable >
</md-content>
{{test}}


If I use the input box in the source item, the ng-model works, but when I bring it to the destination it doesn't work.Here is an example

thank you for help

Update

I figure out that when I drag&drop the input the I can get the value of
test
in the source, and not in the destination (but it's ok for me )
here is an example

Answer

After some investigation and based on that response I find a solution.
the problem was that the cloned code doesn't compile,so angular doesn't know that the ng-model(for example) existe, but after compiling the code using $compile, it works