external-scopes no longer works in ui-grid

耗尽温柔 提交于 2019-12-07 14:01:18

问题


I am upgrading the ui-grid from v3.0.0-RC.18 to v3.0.0-rc.20-76029e7 and suddenly the external-scopes attribute stops working. What is the alternative to it?


回答1:


externalScopes was removed in RC 19. You can read the notes here: https://github.com/angular-ui/ng-grid/blob/master/CHANGELOG.md#breaking-changes

Instead, you can use appScope, which has been docoumented here: http://ui-grid.info/docs/#/tutorial/305_appScope

The grid gets a property called appScope added to it that simply references its parent scope, so you don't have to pass the grid any options. If you have a function named click() on your controller's scope you can access it in your cell templates and whatnot via grid.appScope.click().



来源:https://stackoverflow.com/questions/29508506/external-scopes-no-longer-works-in-ui-grid

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!