AngularJs - updating Bindonce strength using refreshOn attribute

I'm trying to force my bindonce table to update after editing multiple records, but I don't know how to use the refonOn bindonce attribute.

HTML code:

<tbody bindonce="filteredItems" refresh-on="refreshTaskList" ng-repeat="task in filteredItems | orderBy:sortingOrder:reverse">
<tr>
 <td><span bo-bind="task.serviceTypeName | isEmpty : 'None'"></span></td>
  <td ><span bo-bind="task.percentageCompleted | isEmpty : 'Not Started'"></span></td>
</tr>
</tbody>

I call this line in my controller:

$scope.refreshTaskList();

Also, I tried calling it, but nothing works:

$scope.$broadcast('refreshTaskList');

Can you please help someone in my proper use?

+2
source share
1 answer

Change it to: refresh-on="'refreshTaskList'"

Example:

<button ng-click="refresh()">Refresh table</button>

$scope.refresh = function () {
  $scope.$broadcast('refreshTaskList');
};

If it still does not work, you may have a version that does not contain an attribute refresh-on.

Demo: http://plnkr.co/edit/nYPDMRG4b1OtkMolEEDQ?p=preview

+3
source

All Articles