Angular in Rails在生产中引发错误`Error:[$ injector:unpr]未知提供者:e` [英] Angular in Rails throws an error in production `Error: [$injector:unpr] Unknown provider: e`
问题描述
在开发中运行我的应用程序时,它可以正常运行.但是部署后会抛出此错误:
When running my app in development it works fine. but when deployed, it throws this error :
Error: [$injector:unpr] Unknown provider: e
应用程序的网址: http://shimizu.leafycode.com/panel/signin
js文件: https://gist.github.com/THPubs/3a9e088ad3410e18030c
我遵循了其他堆栈溢出的答案,并相应地修复了我的应用程序,但问题仍然存在!请帮忙.
I followed other stack-overflow answers and fixed my app accordingly but still the problem is there! Please help.
推荐答案
您的代码已缩小,我可以看到app.js
中至少有一个地方,您在调用.config
和
Your code is being minified and I can see at least one place in app.js
where you are not using the array notation when calling .config
and .run
因此,在您的app.js
中更新该行
So in your app.js
update the line
.config(function($mdThemingProvider) {
到
.config(['$mdThemingProvider', function($mdThemingProvider) {
// ... Your code ...
}])
和行
.run(function($rootScope, $templateCache) {
到
.run(['$rootScope', '$templateCache', function($rootScope, $templateCache) {
// .. Your code ...
}])
再次检查代码中要注入服务的其他位置.
Double check other places in your code that you are injecting services.
这篇关于Angular in Rails在生产中引发错误`Error:[$ injector:unpr]未知提供者:e`的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!