當我部署我的unminified代碼時,一切都很好。然後我運行grunt build
並從dist
文件夾進行部署,就像你一樣。當我檢查了,雖然它打破了網頁之一,我在控制檯中的錯誤:grunt build給Lexer錯誤,打破應用程序ng-include
Error: [$parse:lexerr] Lexer Error: Unexpected next character at columns 0-0 [\] in expression [\].
http://errors.angularjs.org/1.2.6/$parse/lexerr?p0=Unexpected%20nextharacter%20&p1=s%200-0%20%5B%5C%5D&p2=%5C
at https://353a23c500dde3b2ad58-c49fe7e7355d384845270f4a7a0a7aa1.ssl.cf2.rackc…051d66623ecd89e823feea72a720eec0f43eac2/scripts/244c37f5.vendor.js:3:30474
at Zd.throwError (https://353a23c500dde3b2ad58-c49fe7e7355d384845270f4a7a0a7aa1.ssl.cf2.rackc…051d66623ecd89e823feea72a720eec0f43eac2/scripts/244c37f5.vendor.js:6:14396)
at Zd.lex (https://353a23c500dde3b2ad58-c49fe7e7355d384845270f4a7a0a7aa1.ssl.cf2.rackc…051d66623ecd89e823feea72a720eec0f43eac2/scripts/244c37f5.vendor.js:6:13696)
at $d.parse (https://353a23c500dde3b2ad58-c49fe7e7355d384845270f4a7a0a7aa1.ssl.cf2.rackc…051d66623ecd89e823feea72a720eec0f43eac2/scripts/244c37f5.vendor.js:6:16445)
at https://353a23c500dde3b2ad58-c49fe7e7355d384845270f4a7a0a7aa1.ssl.cf2.rackc…051d66623ecd89e823feea72a720eec0f43eac2/scripts/244c37f5.vendor.js:5:13197
at e.parseAs (https://353a23c500dde3b2ad58-c49fe7e7355d384845270f4a7a0a7aa1.ssl.cf2.rackc…051d66623ecd89e823feea72a720eec0f43eac2/scripts/244c37f5.vendor.js:5:23401)
at Object.e.(anonymous function) [as parseAsResourceUrl] (https://353a23c500dde3b2ad58-c49fe7e7355d384845270f4a7a0a7aa1.ssl.cf2.rackc…051d66623ecd89e823feea72a720eec0f43eac2/scripts/244c37f5.vendor.js:5:23604)
at https://353a23c500dde3b2ad58-c49fe7e7355d384845270f4a7a0a7aa1.ssl.cf2.rackc…051d66623ecd89e823feea72a720eec0f43eac2/scripts/244c37f5.vendor.js:6:28873
at q (https://353a23c500dde3b2ad58-c49fe7e7355d384845270f4a7a0a7aa1.ssl.cf2.rackc…051d66623ecd89e823feea72a720eec0f43eac2/scripts/244c37f5.vendor.js:4:23046)
at h (https://353a23c500dde3b2ad58-c49fe7e7355d384845270f4a7a0a7aa1.ssl.cf2.rackc…051d66623ecd89e823feea72a720eec0f43eac2/scripts/244c37f5.vendor.js:4:19250)
在網頁上我有我懷疑是做斷裂的表達式:
ng-include='"views/posts.html"'
在GitHub上位於dist文件夾標籤如下所示:做
ng-include="\"views/posts.html\""
什麼grunt build
是打碎了我的代碼?它在從app/
部署時起作用,但在從dist/
部署時不起作用。
有沒有更好的方法來寫我的ng-include
?
是否NG-'包括=「'views/posts.html'」'(切換單引號和雙引號)幫助呢?這是我嘗試的第一件事,幾乎是一個瘋狂的猜測。 – ivarni