0

我正在尝试通过以下方式在我的 userMenuController 中注入“modal”指令:

angular.module('mgApp.controllers').controller('userMenuController', ['$scope', 'modals', function($scope, modals) { ... }])

这是modals.js:

angular.module('mgApp.directives').directive('modals', function(){ ... })

在 app.js 上,app 的定义如下:

var app = angular.module('mgApp',['templates', 'angularUtils.directives.dirPagination', 'mgApp.filters', 'mgApp.directives', 'mgApp.services', 'mgApp.controllers']);

但我不断收到此错误:

Error: [$injector:unpr] Unknown provider: modalsProvider <- modals <- userMenuController

我错过了什么?

4

1 回答 1

1

快速思考:确保您已将所有 .js 文件包含为

<script src="*.js"></script> 

在 index.html 文件中

于 2015-11-04T14:06:03.427 回答