我在玩 Angular.dart 作为应用程序框架并尝试使用 Twitter bootstrap 组件和 CSS 样式。我几乎立即遇到了问题,因为 bootstrap 好像不处理 ShadowDOM , 和 Angular.dart 使用 ShadowDOM 为 元器件 .
这基本上意味着我 无法使用 Bootstrap.js 构建 Angular 组件 .使用仅需要 CSS 的 Bootstrap 组件可以很好地与 applyAuthorStyles: true
一起使用在 NgComponent
注解。
有什么办法也可以使用 bootstrap js 组件构建 angular.dart 组件吗?
/岑克
最佳答案
可以使用 applyAuthorStyles: true
修复几件事情但是跨越 shadowDOM 边界的选择器不起作用。您将不得不更改 Bootstrap 的 css。
applyAuthorStyles 已弃用或已删除
这里Feature Request: Add templates for NgDirectives or a NgComponent non-shadow dom option也是关于这个话题的讨论。
它提到了 ng-pseudo
应该有助于解决这个问题的指令。
AFAIK ShadowDOM 也将被移植到 AngularJS,也许这会创建一些盟友并最终进行改进。
聚合物(JS 和 Dart)也有同样的问题。
关于dart - 由于 shadow dom,带有 bootstrap.js 的 angular.dart 组件失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21046347/