我通过npm
和bower
安装了Ember及其依赖项,并在我的应用程序中包含了ember.js
脚本,认为它什么都不做因为我还没有做任何事情
然而,在刷新页面时,我得到5个控制台错误,其中包含不同的“意外标记”和“未定义Ember”。我的应用程序标记中也出现了一个非常奇怪的错误:
“Value”=== e.childNodes [2] .nodeValue}(),o = function(r){var n; n = this instanceof o?this:new e,n.innerHTML = r ; var i =“metamorph - ”+ t ++; return n.start = i +“ - start”,n.end = i +“ - end”,n}; e.prototype = o.prototype; var s,l,u, c,h,m,p,f,d; if(c = function(){return this.startTag()+ this.innerHTML + this.endTag()},f = function(){return“”},d = function(){return“”},n)s = function(e,t){var r = document.createRange(),n = document.getElementById(e.start),i = document.getElementById(e.end );返回t?(r.setStartBefore(n),r.setEndAfter(i)):( r.setStartAfter(n),r.setEndBefore(i)),r},l = function(e,t){var r = s(this,t); r.deleteContents(); var n = r.createContextualFragment(e); r.insertNode(n)},u = function(){var e = s(this,!0); e.deleteContents()},h = function(e){var t = document.createRange(); t.setStart(e),t.collapse(!1); var r = t.createContextualFragment(this.outerHTML() ); e.appendChild(r)},m = function(e){var t = document.createRange(),r = document.getElementById(this.end); t.setStartAfter(r),t.setEndAfter(r) ; var n = t.createContextualFragment(e); t.insertNo de(n)},p = function(e){var t = document.createRange(),r = document.getElementById(this.start); t.setStartAfter(r),t.setEndAfter(r); var n = t.createContextualFragment(E); t.insertNode(N)}; EL
我如何开始排除故障?我做错了什么?
在此处添加了ember.js:
script(type='text/javascript'): include ../../bower_components/ember/ember.min.js
script(type='text/javascript'): include ../../bower_components/ember-data/ember-data.min.js
script(type='text/javascript'): include ../../bower_components/d3/d3.min.js
script(type='text/javascript'): include ../../bower_components/handlebars/handlebars.min.js
script(type='text/javascript'): include ../../bower_components/lodash/dist/lodash.min.js
script(type='text/javascript'): include ../../bower_components/ember-charts/dist/ember-charts.js
答案 0 :(得分:1)
在jade中,您使用script(src=)
语法创建指向外部文档的链接。当您想要将一个文件的内容插入另一个文件时,将使用include
关键字。
尝试将脚本行更改为:
script(type='text/javascript' src='../../bower_components/ember/ember.min.js')