Update UI elements with filter in Angular

123 views Asked by At

I have a list with data-ng-repeat, filtering on the elements displayed.

<ul>
   <li data-ng-repeat="topic in topics | belongs:projectID">
      <span>{{device.name}}  </span><a data-ng-click="unassignDevice(project, device)">Unassign</a>
   </li>
</ul>

The filter works fine but when I update a topic with something like

topic.projectID = 123;

It does not refresh. When I reload everything displays correctly, so the assignment works and the filter works, it is only the UI that is not refreshing. This makes sense as the $scope.topics has not changed, so... how do I do the refresh?

1

There are 1 answers

2
jKlaus On

It may be worth looking at the implementation of data-ng-repeat. You may be editing a copy of the data set, not the actual data set.