2014-11-24 61 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

回答