我使用AngularJS的网格,在一个列中,我调用一个函数来返回一些html。在调试这个函数时,我注意到它被无限调用。我将函数更改为只测试(“console.log”),并且“测试”被疯狂地打印出来。
我是AngularJS的新手,我在我公司的这个项目中工作。
以下是列的定义:
{
field: "statusId", width: '8%', enableSorting: true, displayName: "", enableHiding: false, enableFiltering: false,
cellTemplate: "<div class='ui-grid-cell-contents' ng-bind-html='grid.appScope.getIcon(row.entity.statusId)'></div>"
}
和函数:
$scope.getIcon = function (statusId) {
console.log("getIcon");
};
我不知道你们需要什么代码来帮助。请在评论中让我知道。
发布于 2018-06-06 04:42:45
这似乎是一个错误,请看:Multiple grid.appScope calls when used in cellTemplate
要克服这一点,可以使用指令。
https://stackoverflow.com/questions/50685633
复制相似问题