javascript - 在 d3.js 生成的新元素中获取 Angular 以执行 ng-if

标签 javascript angularjs svg d3.js angularjs-directive

我正在生成一系列 <circle ng-if='n'> someScopeFunction()' \>使用 d3.js

如何让 Angular 注意到并处理这些新元素和 ng-ifs?

我怎样才能用 Angular 变量来做到这一点,例如<circle some-attr='{{i - 2}}' />

最佳答案

ng-if is a directive ,您可以使用此解决方案: How do I use angularjs directives in generated d3 html?

唯一的假设是你的 d3 已经在一个指令中。

关于javascript - 在 d3.js 生成的新元素中获取 Angular 以执行 ng-if,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30891342/

相关文章:

google-chrome - Chrome 中的 SVG 比 Firefox 中的 SVG 更宽

java - 使用 SWT 在 Java 中呈现 SVG - Batik 太慢

javascript - 在我的自定义 wordpress 模板中进行两级切换

javascript - 在 angularjs 中对表的行进行排序或重新排列(拖放)

javascript - Angular : use a variable into <div>

javascript - 禁用 angularjs 中的表格行

javascript - 设置回调数组并尝试使用数组索引作为回调中的值

javascript - 火狐插件-sdk : get element of attached panel

javascript - 输入数据更改时,AngularJs 不会更新模型

html - 如何在 svg 圆的中心设置图像?