2014-11-24 59 views
2

我試圖在Angular中獲取堆棧跟蹤,它告訴我我出錯的地方。相反,我只是獲取錯誤通過Angular傳播的列表。有時錯誤信息會有幫助,但並非總是如此,但這對我來說並不重要:我想知道確切的行號以及文件名,我的代碼在哪裏出錯。例如,下面是一個典型的螢火蟲消息:Firebug:角度堆棧跟蹤不顯示錯誤的來源(行號,文件)

錯誤:[NG:AREQ]參數 'TackleController' 不是一個函數,得到了未定義http://errors.angularjs.org/1.3.3/ng/areq?p0=TackleController&p1=not%20a%20function%2C%20got%20undefined minErr/< @http:// 本地主機:63342 /釣魚/ bower_components/angular/angular.js:63:12 assertArg @ http:// localhost:63342/fishing/bower_components/angular/angular.js:1560:1 assertArgFn @ http:// localhost:63342/fishing/bower_components/angular/angular.js:1570:1 $ ControllerProvider /這$得到</< @http:// 本地主機:63342 /釣魚/ bower_components /角/ angular.js:8347:9 nodeLinkFn/< @http:// 本地主機:63342/fishing/bower_components/angular/angular.js:7517:34 forEach @ ht tp:// localhost:63342/fishing/bower_components/angular/angular.js:330:11 nodeLinkFn @ http:// localhost:63342/fishing/bower_components/angular/angular.js:7504:11 compositeLinkFn @ http: // localhost:63342/fishing/bower_components/angular/angular.js:7003:13 compositeLinkFn @ http:// localhost:63342/fishing/bower_components/angular/angular.js:7006:13 publicLinkFn @ http:// localhost:63342/fishing/bower_components/angular/angular.js:6882:30 bootstrapApply/< @http:// localhost:63342/fishing/bower_components/angular/angular.js:1439:11 $ RootScopeProvider/this。 $ get < /[email protected]: localhost:63342/fishing/bower_components/angular/angular.js:14204:16 $ RootScopeProvider/this。$ get < /[email protected]: localhost:63342/fishing/bower_components/angular/angular.js:14302:18 bootstrapApply @ http:// localhost:63342/fishing/bower_components/angular/angular。 js:1437:9 invoke @ http:// localhost:63342/fishing/bower_components/angular/angular.js:4129:14 bootstrap/doBootstrap @ http:// localhost:63342/fishing/bower_components/angular/angular。 js:1435:1 bootstrap @ http:// localhost:63342/fishing/bower_components/angular/angular.js:1455:1 angularInit @ http:// localhost:63342/fishing/bower_components/angular/angular.js: 1349:5 @http:// localhost:63342/fishing/bower_components/angular/angular.js:25746:5 trigger @ http:// localhost:63342/fishing/bower_components/angular/angular.js:2720:7 createEventHandler /偶tHandler @ http:// localhost:63342/fishing/bower_components/angular/angular.js:2990:9

在這種情況下,問題在於我引用了一個我沒有定義的HTML控制器;我發佈這個作爲我的意思的一個例子,不是因爲我想要幫助解決這個問題。我猜這是因爲Firebug自動截斷了20個錯誤的堆棧跟蹤?但我怎麼能改變這一點?

P.S. 我是Angular的小菜鳥。如果這個答案在其他地方重複,請實際上將我與問題聯繫起來,而不是粗略地刪除問題。

+0

你能告訴我們一些代碼,你寫的是什麼?按照錯誤就說明'參數「TackleController」不是一個函數,得到了undefined' – 2014-11-24 03:38:54

+0

我沒有定義TackleController可言。我在顯示錯誤的一點是,他們沒有表明我試圖引用一個未定義的變量。這就是我想得到的,錯誤所在的實際行號。我不在乎這個具體的錯誤,因爲我已經知道它爲什麼會拋出。 – user3522492 2014-11-24 03:47:00

+0

仍然沒有看到代碼,我不能回答 – 2014-11-24 12:17:39

回答