【发布时间】:2014-02-17 12:16:52
【问题描述】:
我有一个 ng-repeat 工作正常。我应用了一个也可以正常工作的 x-editable。有很多页,应用了分页。我正在使用 ng-table。然而,当使用 jquery x-editabe(通过其 ajax 方法)更新某些记录时,angularjs、ng-repeat 停止更新该特定的 .为什么?
<td title="'Price'" data-type="number" my-x-editable data-sortable="'Price'" filter="
{'Price':'text'}">{{product.Price}}
</td>
<td title="'Vendor'" data-sortable="'Vendor'" filter="{'Price':'text'}">
<a href="#" id="VendorID" class ="xEditable" data-type="select" data-pk="{{product.ID}}" data-source='@Url.Action("ProductVendors")' data-value="{{product.Vendor.ID}}" data-url ="@Url.Action("UpdateAttributes")" title ="@Resources.OA_Attribute_Vendor">{{product.Vendor.Name}}</a>
</td>
如果我不使用 x-editable 进行更新,一切都会正常运行。当我使用 x-editable 时,当我转到下一页时,该特定列不会用 ng-repeat 更新。
【问题讨论】:
-
这里的问题是你在 Angular 之外操作一个作用域属性。 Angular 理解更改是基于运行
$digest并进行脏检查而做出的。因此,如果外部库正在更改数据,Angular 将不会知道。
标签: javascript jquery angularjs angularjs-ng-repeat x-editable