在ag-grid中,angularCompileRows选项有什么作用? [英] In ag-grid, what does the option angularCompileRows do?

查看:94
本文介绍了在ag-grid中,angularCompileRows选项有什么作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我今天试图在 ag-grid 中获取单个单元格,以针对父控制器中的scope方法触发 ng-click 事件,并尝试了许多不同的方法事物.在查看人们发布的一些工作代码后,我注意到每个人都在 gridOptions 中将 angularCompileRows 设置为 true .我尝试在自己的代码中打开 angularCompileRows ,它成功了! ng单击并触发并调用控制器方法.

I was trying to get individual cells in an ag-grid to fire ng-click events against a scope method in a parent controller today and tried a ton of different things. After looking at some working code people had posted, I noticed that everyone was setting angularCompileRows to true in the gridOptions. I tried turning angularCompileRows on in my own code and it worked! ng-click fired and called the controller method.

我的问题是: ag-grid 中的 angularCompileRows 到底有什么作用?我在官方文档中只能找到一个参考(在此页面),说明就很轻巧.我想知道是否有任何副作用/不利于打开此选项.

My question is: what exactly does angularCompileRows in ag-grid do? I can only find one reference to it in the official documentation (in the code examples on this page) and it's very light on explanation. I'm wondering if there are any side effects/downsides to turning this option on.

推荐答案

稍作搜索后,我发现".

After googling a bit, I found this in the documentation.

据我了解,默认情况下,ag-grid是使用原始JavaScript构建的,以提高性能.但是,如果您愿意承受性能方面的损失,可以将 angularCompileRows 设置为 true ,它将为每行创建一个新的作用域,并且您将能够在内部利用AngularJS单元格渲染器.我认为这就是除非将 angularCompileRows 设置为 true

From what I understand, by default ag-grid is built using raw JavaScript for performance purposes. However, if you are willing to take the performance hit, you can set angularCompileRows to true and it will create a new scope per row and you will be able to leverage AngularJS inside Cell Renderers. I think this is why the AngularJS ng- events don't work unless you set angularCompileRows to true

这篇关于在ag-grid中,angularCompileRows选项有什么作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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