Skip to content Skip to sidebar Skip to footer

Saving With Angular $resource.save Causes View To Redraw/reflow Due To Collection Watcher

I have a model which I load and store using $resource. The model is an aggregate and has nested collections inside, which are binded to an html view using ng-repeat. Model: { s

Solution 1:

You can use $http service to avoid model updates that $save cause:

$scope.save2 = ->  $http.get 'blah_new.json'

I used get in example but you can use whatever you need from this list of shortcut methods. And here is a simple example plunk.

Also it's simple to save elemen's focus after rerendering:

$scope.save = -> 
    active = document.activeElement.getAttribute 'id'$scope.user1.$save ->
      document.getElementById(active).focus()

Post a Comment for "Saving With Angular $resource.save Causes View To Redraw/reflow Due To Collection Watcher"