Angular.js: Is it possible to re-render ng-repeats based on existing scope data?

后端 未结 1 1841
一个人的身影
一个人的身影 2021-01-01 11:53

I have a bunch of connected ul lists in my view which are using a jQuery UI: Sortable directive to facilitate drag and drop and reordering of the list items.

相关标签:
1条回答
  • 2021-01-01 12:39

    When the user starts filling out the form, I would set

    $scope.oldData = angular.copy($scope.data);

    Then let the user edit $scope.data using the form as he likes.

    Then if the user presses cancel, just set $scope.data = $scope.oldData.

    0 讨论(0)
提交回复
热议问题