2016-02-26 103 views
2

我收到寫着遷移從角1.3〜1.5

angular.js:13236 Error: [ng:areq] Argument 'fn' is not a function, got undefined 
http://errors.angularjs.org/1.5.0/ng/areq?p0=fn&p1=not%20aNaNunction%2C%20got%20undefined 
at http://localhost:3000/bower_components/angular/angular.js:68:12 
at assertArg (http://localhost:3000/bower_components/angular/angular.js:1825:11) 
at assertArgFn (http://localhost:3000/bower_components/angular/angular.js:1835:3) 
at Promise.promise.error (http://localhost:3000/bower_components/angular/angular.js:10979:11) 
at Object.getUserChannels (http://localhost:3000/scripts/services/media-service.js:38:37) 
at activate (http://localhost:3000/scripts/controllers/player-controller.js:63:22) 
at new <anonymous> (http://localhost:3000/scripts/controllers/player-controller.js:28:9) 

控制器和工廠遷移之前工作過的錯誤,我無法找到,顯示到工廠的任何變化的任何文件。對我來說,它看起來像控制器找不到功能是mediaSVC文件

+0

你能告訴我們你的代碼嗎? –

+1

我認爲你應該先通過這個[遷移指南](https://docs.angularjs.org/guide/migration) –

回答

0

你檢查你是否在1.3中使用延遲加載你的服務和工廠?如果是這樣,請確保在遷移到1.5時開始調用它們之前,它們已被預先加載。這是遷移的大型企業應用程序時,我已經經歷了從1.4到1.5的一件事:

http://www.diatomenterprises.com/migration-history-from-angularjs-1-3-to-1-5-and-then-2-0/

延遲加載可能需要一點點的關注和另一個小圖書館,讓它在1.5正常工作。如果問題仍然存在,我可以幫助你。