0
我在我的应用程序中使用角js智能表。在初始加载过程中,每件事都可以正常工然而,我有一个按钮(它在智能表外)在一些条件发生变化时刷新数据。在按钮单击我调用changeView函数重新填充rowCollection数据如下所示。根据我在角度js方面的知识,这个数据变化应该反映在视图中(双向数据绑定)。问题与角js智能表更改按钮点击数据
但按钮单击后,只有标题出现在我的智能表中,所有剩余的数据将被删除。任何人都可以指出我的方法有什么缺陷? getKPIModesData以正确的格式重新调用所需的json数据,这没有问题。
$scope.changeView = function(selectedAccount, selectedCarrierList, fromDate, toDate) {
$scope.rowCollection = DashboardsDataService.getKPIModesData(selectedAccount, selectedCarrierList, fromDate, toDate);
}
更多详细资料(和plunkr)要退从getKPIModesData功能的承诺? – 2014-09-19 11:26:29
不,我没有使用任何承诺。是否必须使用从服务中获取数据? – 2014-09-19 11:33:03
这是一个很好的做法,并且在这行之后使用console.log($ scope.rowCollection)$ scope.rowCollection = DashboardsDataService.getKPIModesData(selectedAccount,selectedCarrierList,fromDate,toDate);并告诉我,如果你仍然看到你想看到的数据 – 2014-09-19 11:35:14