外部作用域在ui-grid中不再起作用 [英] external-scopes no longer works in ui-grid

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

问题描述

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

解决方案

externalScopes在RC 19中已删除.您可以在此处阅读说明: http://ui-grid. info/docs/#/tutorial/305_appScope

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

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

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

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