使用带有Bootstrap的angular.dart产生对象#<document>没有方法&#39; getAttribute&#39; </document>

时间:2014-04-11 08:28:35

标签: 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)" 

1 个答案:

答案 0 :(得分:3)

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

可能,那个会更适合你。

最诚挚的问候, 保罗