2

Is it possible to temporarily disable data binding in AngularJS. I have a list items which I render using ng-repeat. I want to do some list operations on items, while data-binding is temporarily disabled, so that the intermediary changes are not reflected on the page thereby slowing it down. Instead I want to perform the operations on the list and thereafter re-enable data binding.

2
  • 1
    You could always perform these list operations on a copy of the items if that is feasible for your situation. More context would help. Commented Mar 6, 2014 at 7:17
  • The model already only updates after the code that does the manipulation has run. You may need to describe how the manipulation works to get anything more useful. Commented Mar 6, 2014 at 7:18

1 Answer 1

3
var items = angular.copy($scope.items);
..
..
..
/* perform operations over items */
..
..
..
$scope.items = angular.copy(items);
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.