Angular 4 - 我需要帮助调试ZoneAwareError

时间:2017-05-10 07:48:04

标签: angular

我是否需要帮助调试此错误以找出问题所在? 我使用Angular4并且通常在我在html中遇到问题时出现,但是没有指出哪个,或者至少我不知道如何看到它,并且每次找到它时都会丢失很多时间。 问候。

"Error: Uncaught (in promise): Error
Error
at Error.ZoneAwareError (http://localhost:4200/polyfills.bundle.js:3752:33)
at ZoneAwareError (http://localhost:4200/polyfills.bundle.js:3749:35)
at injectionError (http://localhost:4200/vendor.bundle.js:1442:86)
at noProviderError (http://localhost:4200/vendor.bundle.js:1480:12)
at ReflectiveInjector_._throwOrNull 
(http://localhost:4200/vendor.bundle.js:2981:19)
at ReflectiveInjector_._getByKeyDefault 
(http://localhost:4200/vendor.bundle.js:3020:25)
at ReflectiveInjector_._getByKey 
(http://localhost:4200/vendor.bundle.js:2952:25)
at ReflectiveInjector_.get (http://localhost:4200/vendor.bundle.js:2821:21)
at AppModuleInjector.NgModuleInjector.get 
(http://localhost:4200/vendor.bundle.js:3768:52)
at AdminModuleInjector.NgModuleInjector.get 
(http://localhost:4200/vendor.bundle.js:3768:52)
at resolveDep (http://localhost:4200/vendor.bundle.js:11135:45)
at createClass (http://localhost:4200/vendor.bundle.js:10993:35)
at createDirectiveInstance (http://localhost:4200/vendor.bundle.js:10832:37)
at createViewNodes (http://localhost:4200/vendor.bundle.js:12182:49)
at createRootView (http://localhost:4200/vendor.bundle.js:12087:5)
at ZoneAwareError (http://localhost:4200/polyfills.bundle.js:3752:33)
at resolvePromise (http://localhost:4200/polyfills.bundle.js:3425:31)
at resolvePromise (http://localhost:4200/polyfills.bundle.js:3396:17)
at http://localhost:4200/polyfills.bundle.js:3473:17
at ZoneDelegate.invokeTask 
(http://localhost:4200/polyfills.bundle.js:3127:31)
at Object.onInvokeTask (http://localhost:4200/vendor.bundle.js:4327:37)
at ZoneDelegate.invokeTask 
(http://localhost:4200/polyfills.bundle.js:3126:36)
at Zone.runTask (http://localhost:4200/polyfills.bundle.js:2926:47)
at drainMicroTaskQueue (http://localhost:4200/polyfills.bundle.js:3306:35)
at HTMLButtonElement.ZoneTask.invoke 
(http://localhost:4200/polyfills.bundle.js:3184:25)"

1 个答案:

答案 0 :(得分:0)

现在我明白了! 在:

    "Error: Uncaught (in promise): Error
Error
at Error.ZoneAwareError (http://localhost:4200/polyfills.bundle.js:3752:33)
at ZoneAwareError (http://localhost:4200/polyfills.bundle.js:3749:35)
at injectionError (http://localhost:4200/vendor.bundle.js:1442:86)
at noProviderError (http://localhost:4200/vendor.bundle.js:1480:12)

我在组件中注入一个服务( injectionError ),我没有在模块中声明它作为提供者( noProviderError )。