问题
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