0

I'm integrating in an angularJS app a non angularJS module for dragging items in a list (or across several list items containers) and the lists themselves are bound to an object containing several arrays (the model) and an ng-repeat generates the items in each list. When performing a drag across lists, the drag module does it job perfectly in the html but doesn't update the model so i had to try that in its "dragend" event but the problem was that the lists twinkle and i wish i could avoid that effect. I need the view to be generated initially according to the model then disconnect the model and the view.

Bardelman
  • 2,176
  • 7
  • 43
  • 70
  • is it angular or angular js please confirm ? – Rahul Singh Nov 06 '17 at 10:09
  • yes, it's a v1.5 – Bardelman Nov 06 '17 at 10:10
  • 1
    then it is angular js not angular – Rahul Singh Nov 06 '17 at 10:10
  • call $scope.apply after changing the items with your external module, or add a $scope.watch on the items your external module make changes to – Jasper Seinhorst Nov 06 '17 at 10:14
  • @RahulSingh to be fair, that's more to do with how Google decided to confuse everyone with the names, than with Bardelman messing up. :) – Jordumus Nov 06 '17 at 10:25
  • Have you thought of cloning the original object and updating only the clone based on the changes you get from the "dragend" event? This way the original will remain as the model and a snapshot of the initial state and the clone can reflect manipulations without affecting the model. – Vorcan Nov 06 '17 at 10:26
  • 1
    @Jordumus i get that but they are trying to raise awareness to the same, it should be still denoted as Angular js as no where it mentioned you can tell angular js as angular that was developers discretion – Rahul Singh Nov 06 '17 at 10:27
  • can you make a fiddle? – Gaurav Srivastava Nov 06 '17 at 10:34
  • 1
    [what about one way binding](https://stackoverflow.com/a/28354057/5621827) – jitender Nov 06 '17 at 10:40
  • @Vorcan i need update the model not a clone for further usage. The lists do not only update by drag but from elsewhere, i need updates to be merged all together in the original model. – Bardelman Nov 06 '17 at 11:29

0 Answers0