客户端错误使用angularjs.org 1.2.15 $ injector

时间:2017-06-09 13:56:13

标签: angularjs

我是Angular的新秀。

任何人都可以让我知道我在Web应用程序中遇到的以下客户端错误的可能来源/原因是什么?

HTML1300: Navigation occurred.
File: DEPM-ap01
Loading context root...
Context root loaded
Returning context:  /DEPM-ap01
Error: [$injector:unpr] http://errors.angularjs.org/1.2.15/$injector/unpr?p0=EnvelopeCreationServiceProvider%20%3C-%20EnvelopeCreationService%20%3C-%20dsInboxTasksDirective
   at Anonymous function (eval code:34:504)
   at c (eval code:33:51)
   at Anonymous function (eval code:35:55)
   at c (eval code:33:51)
   at d (eval code:33:265)
   at Anonymous function (eval code:43:84)
   at r (eval code:7:278)
   at Anonymous function (eval code:43:59)
   at d (eval code:33:326)
   at Anonymous function (eval code:35:68)
Error: [$injector:unpr] http://errors.angularjs.org/1.2.15/$injector/unpr?p0=EnvelopeCreationServiceProvider%20%3C-%20EnvelopeCreationService
   at Anonymous function (eval code:34:504)
   at c (eval code:33:51)
   at Anonymous function (eval code:35:55)
   at c (eval code:33:51)
   at d (eval code:33:265)
   at instantiate (eval code:33:462)
   at Anonymous function (eval code:65:482)
   at link (eval code:7:246)
   at J (eval code:52:492)
   at h (eval code:46:28) <div class="ng-scope" ng-view="">
Error: [$compile:tplrt] http://errors.angularjs.org/1.2.15/$compile/tplrt?p0=dsNavbar&p1=docsphere%2Fdirectives%2Fds-navbar%2Fds-navbar-directive.html
   at Anonymous function (eval code:58:365)
   at Anonymous function (eval code:70:373)
   at H (eval code:96:502)
   at H (eval code:96:502)
   at H (eval code:96:502)
   at Anonymous function (eval code:98:163)
   at h.prototype.$eval (eval code:108:29)
   at h.prototype.$digest (eval code:105:323)
   at h.prototype.$apply (eval code:108:368)
   at g (eval code:71:118)

1 个答案:

答案 0 :(得分:0)

也许您已经在指令后声明了您的服务,您试图在您的指令中使用“EnvelopeCreationService”并且此指令找不到此服务,您必须检查:

1 - 您将此声明为服务而非提供者:

angular.module('module', []).service('EnvelopeCreationService', fn);

2 - 也许你在指令的JS文件

之后包含了服务的JS