2012-06-12 72 views
0

加載angularjs時出現奇怪的錯誤。我試圖在網上搜索,但沒有發現。你知道這是什麼意思嗎?加載Angularjs時出現錯誤

Error: Syntax Error: Token ',' is an unexpected token at column 5 of the expression ['ar', 'Arabic'), 
... 
('zh-tw', 'Traditional Chinese']. 
at Error (unknown source) 
at throwError (http://127.0.0.1:8001/static/js/libs/angularjs/angular-1.0.0rc11.js:5845:11) 
at parser (http://127.0.0.1:8001/static/js/libs/angularjs/angular-1.0.0rc11.js:5839:5) 
at http://127.0.0.1:8001/static/js/libs/angularjs/angular-1.0.0rc11.js:6402:29 
at http://127.0.0.1:8001/static/js/libs/angularjs/angular-1.0.0rc11.js:4822:27 
at addTextInterpolateDirective (http://127.0.0.1:8001/static/js/libs/angularjs/angular-1.0.0rc11.js:4406:27) 
at collectDirectives (http://127.0.0.1:8001/static/js/libs/angularjs/angular-1.0.0rc11.js:3908:11) 
at compileNodes (http://127.0.0.1:8001/static/js/libs/angularjs/angular-1.0.0rc11.js:3798:21) 
at compileNodes (http://127.0.0.1:8001/static/js/libs/angularjs/angular-1.0.0rc11.js:3806:14) 
at compileNodes (http://127.0.0.1:8001/static/js/libs/angularjs/angular-1.0.0rc11.js:3806:14) angular-1.0.0rc11.js:5541 
$get 
+0

您是否在下載之後修改JS文件?由於語法不正確,你得到的是解析器錯誤。 – xbonez

回答

1

經過數小時的反覆試驗,終於找到了這裏發生的事情。認爲它值得與你們分享,以便在面臨同樣問題時不會浪費時間。

問題是,在配置interpolateProvider時,我使用了錯誤的開始((()和結束()))符號。將開始和結束符號更改爲另一個符號後,錯誤消失。