外部范围不再适用于 ui-grid [英] external-scopes no longer works in ui-grid

查看:27
本文介绍了外部范围不再适用于 ui-grid的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将 ui-grid 从 v3.0.0-RC.18 升级到 v3.0.0-rc.20-76029e7,突然 external-scopes 属性停止工作.它的替代品是什么?

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?

推荐答案

externalScopes 已在 RC 19 中删除.您可以在此处阅读注释:https://github.com/angular-ui/ng-grid/blob/master/CHANGELOG.md#break-changes

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

相反,您可以使用 appScope,已在此处记录:http://ui-grid.info/docs/#/tutorial/305_appScope

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

网格会添加一个名为 appScope 的属性,该属性仅引用其父作用域,因此您不必向网格传递任何选项.如果您的控制器范围内有一个名为 click() 的函数,您可以在单元格模板中访问它,而不能通过 grid.appScope.click() 访问它.

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().

这篇关于外部范围不再适用于 ui-grid的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆