AngularJs - 使用refreshOn属性Bindonce力刷新 [英] AngularJs - Bindonce force refresh using refreshOn attribute
本文介绍了AngularJs - 使用refreshOn属性Bindonce力刷新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图强行刷新编辑几张唱片后,我的bindonce表,但我不知道如何bindonce refreshOn属性使用。
I am trying to force refresh my bindonce table after editing few records but I dont know how to use bindonce refreshOn attribute.
HTML code:
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 am calling this line in my Controller:
$scope.refreshTaskList();
另外,我试着打电话这个问题,以及,但没有作品:
Also, I tried calling this as well but nothing works:
$scope.$broadcast('refreshTaskList');
你能不能请人帮助我如何以适当的方式来使用它?
Can you anyone please help me how to use this in a proper manner?
推荐答案
将其更改为:刷新上='refreshTaskList'
例如:
<button ng-click="refresh()">Refresh table</button>
$scope.refresh = function () {
$scope.$broadcast('refreshTaskList');
};
如果它仍然不工作,你可能有一个不包含 A版刷新上
属性。
If it still doesn't work you might have a version that doesn't contain the refresh-on
attribute.
演示: http://plnkr.co/编辑/ nYPDMRG4b1OtkMolEEDQ?p = preVIEW
这篇关于AngularJs - 使用refreshOn属性Bindonce力刷新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文