发现的原因和QUOT;未知提供商QUOT;错误

问题描述:

我收到以下错误:

Error: [$injector:unpr] Unknown provider: nProvider <- n

我知道这是正在由微小的过程造成的,我明白为什么。但是有一种简单的方法来确定哪些文件实际上是导致了问题?

I know this is being caused by the minification process and I understand why. However is there an easy way to determine which file is actually causing the issue?

角1.3.x中有放置为NG-应用指令在相同的元素的NG-严格二指令。该元素将导致您的应用程序依赖时没有注明抛出一个错误。虽然现在还是不给你得罪code的行号,但它确实给你它的参数的功能(即功能($范围,服务名)),这是希望够独特,你可以找到它pretty迅速在一个良好的code编辑。

Angular 1.3.x has an ng-strict-di directive that is placed on the same element as the ng-app directive. This element causes your app to throw an error whenever dependencies have not been annotated. While it still doesn't give you the line number of the offending code, it does give you the function with its parameters (i.e. function($scope, myServiceName)) which is hopefully unique enough that you can find it pretty quickly in a good code edit.

该指令的一个很好的概述:ng-strict-di.

A good overview of the directive: ng-strict-di.