当使用 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>
纯文本的堆栈跟踪:
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/