dart - 将 angular.dart 与 Bootstrap 一起使用会产生对象 #<Document> 没有方法 'getAttribute'

标签 dart angular-dart shadow-dom

当使用 Angular.dart 0.9.10 和 bootstrap 3.1.1 并编译为 Javascript 时,我在下面附加了一个丑陋的堆栈跟踪。

每当我聚焦文本字段或输入一些文本时,堆栈跟踪都会打印在控制台中。

这之前已经有效,所以我想知道这是否是shadow_dom实现的一个错误?

该应用程序目前非常简单,并且可以与 Dartium 一起正常运行。在 Firefox 和 Chrome 中编译 javascript 后都会出现同样的问题。

当我从 index.html 中删除以下行时它会起作用

<script src="packages/shadow_dom/shadow_dom.debug.js"></script>

Stacktrace 纯文本的堆栈跟踪:

TypeError {stack: "TypeError: Object # has no method 'getAt…/packages/shadow_dom/shadow_dom.debug.js:2805:28)", message: "Object # has no method 'getAttribute'"}
message: "Object # has no method 'getAttribute'"
stack: "TypeError: Object # has no method 'getAttribute'↵    at Function.Sizzle.attr (http://localhost:8000/bower_components/jquery/dist/jquery.js:1422:9)↵    at Array. (http://localhost:8000/bower_components/jquery/dist/jquery.js:1618:25)↵    at http://localhost:8000/bower_components/jquery/dist/jquery.js:2116:22↵    at superMatcher (http://localhost:8000/bower_components/jquery/dist/jquery.js:2322:12)↵    at select (http://localhost:8000/bower_components/jquery/dist/jquery.js:2483:28)↵    at Function.Sizzle (http://localhost:8000/bower_components/jquery/dist/jquery.js:838:9)↵    at HTMLDocument.jQuery.event.handlers (http://localhost:8000/bower_components/jquery/dist/jquery.js:4416:48)↵    at HTMLDocument.jQuery.event.dispatch (http://localhost:8000/bower_components/jquery/dist/jquery.js:4353:40)↵    at Document.elemData.handle (http://localhost:8000/bower_components/jquery/dist/jquery.js:4057:28)↵    at invoke (http://localhost:8000/packages/shadow_dom/shadow_dom.debug.js:2805:28)"
__proto__: Error
constructor: function TypeError() { [native code] }
name: "TypeError"
stack: undefined
__proto__: d
 "TypeError: Object # has no method 'getAttribute'
    at Function.Sizzle.attr (http://localhost:8000/bower_components/jquery/dist/jquery.js:1422:9)
    at Array. (http://localhost:8000/bower_components/jquery/dist/jquery.js:1618:25)
    at http://localhost:8000/bower_components/jquery/dist/jquery.js:2116:22
    at superMatcher (http://localhost:8000/bower_components/jquery/dist/jquery.js:2322:12)
    at select (http://localhost:8000/bower_components/jquery/dist/jquery.js:2483:28)
    at Function.Sizzle (http://localhost:8000/bower_components/jquery/dist/jquery.js:838:9)
    at HTMLDocument.jQuery.event.handlers (http://localhost:8000/bower_components/jquery/dist/jquery.js:4416:48)
    at HTMLDocument.jQuery.event.dispatch (http://localhost:8000/bower_components/jquery/dist/jquery.js:4353:40)
    at Document.elemData.handle (http://localhost:8000/bower_components/jquery/dist/jquery.js:4057:28)
    at invoke (http://localhost:8000/packages/shadow_dom/shadow_dom.debug.js:2805:28)" 

最佳答案

我不确定具体的细节,但 Angular dart 有一个 boostrap 实现: https://github.com/akserg/angular.dart.ui

很可能,那个会更适合你。

最诚挚的问候, 保罗

关于dart - 将 angular.dart 与 Bootstrap 一起使用会产生对象 #<Document> 没有方法 'getAttribute',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23007373/

相关文章:

dart - 如何以编程方式在 flutter 中突出显示字符串中的单词

dart - 装饰器数据绑定(bind)

dart - 如何调试 angular.dart 模板?

javascript - 如何在没有 attachShadow 的情况下创建自定义元素?

影子根或影子根中所有顶级元素的 CSS 选择器

android - 如何在Flutter中实现类似iOS的流畅页面过渡动画?

flutter - 无法更改 MaterialButton 的宽度

iterator - 如何实现与Angular Dart一起使用的迭代器

dart - 如果 Angular.dart 依赖于 shadow dom,这是一个问题吗?

javascript - 使用addthis或外部javascript更新 polymer 元素shadow dom中的div