在发布这个问题之前,我已经研究过很多关于"未知提供商"错误,但我找不到像我的情况。
基本上在我的app.js中,我已经定义了我的主应用程序模块,名为 - &#34; bookingsApp&#34;,我正在为它添加一个值配方,称为 - &#34; connectionWithServerErrorMessage&#34;。< / p>
然后,我在服务中访问这个值配方,名为 - &#34; httpPostingExampleService&#34;。直到现在没有问题。请注意,此服务的测试正确传递。
问题来了,当我在另一个服务中调用此服务中的方法时。例如,在这种情况下,服务称为&#34; bookingElementExampleService&#34;。请参阅plunkr以获得更好的理解:http://plnkr.co/edit/0Z3ZiQXPGdkD08r9Akci
问题是,当我来测试这个其他服务(bookingElementExampleService)时,由于以下错误而失败:
Error: Unknown provider: connectionWithServerErrorMessageProvider <- connectionWithServerErrorMessage <- httpPostingService
注意:应用程序运行正常,没有输出错误,问题就在于测试失败。
老实说,我无法理解,我认为我已经正确设置了所有模块依赖项,因此无法确定问题是什么。有什么帮助吗?
更新
这是我的业力配置文件:
// list of files / patterns to load in the browser
files: [
//First include all dependencies
'app/lib/jquery/jquery-1.8.3.min.js',
'bower_components/qtip2/jquery.qtip.js',
'app/lib/angular/angular.js',
'app/lib/angular/angular-mocks.js',
'bower_components/angular-debounce/dist/angular-debounce.min.js',
'app/lib/ui-bootstrap/ui-bootstrap-custom-tpls-0.12.0.min.js',
//Then include application and any module definitions which are required to be loaded first
'app/app.js',
'app/components/http-posting/http-posting.js',
'app/components/booking-element/booking-element.js',
'app/components/bookings/bookings-ui.js',
'app/components/date-and-stats/date-and-stats.js',
'app/components/timeline/timeline.js',
//Then include all other files required
'app/*.js',
'app/components/**/*.js',
//Then include all partial files
'app/components/**/*.html' //html files (partials)
],