【发布时间】:2014-10-07 16:45:59
【问题描述】:
我尝试将自定义服务注入到模块配置函数中,但我收到一个错误,提示该服务未定义:
var myApp = angular.module('myApp', []);
myApp.config(function($httpProvider, CommonConfigService) {
var baseUrl = CommonConfigService.getRESTUrl();
});
我在几个控制器中使用它没有任何问题。
谁能提示我如何解决这个问题?
感谢和亲切的问候
【问题讨论】:
-
是服务被注入到 angular.module('myApp.services')
标签: angularjs dependency-injection