Angular in Rails在生产中引发错误`Error:[$ injector:unpr]未知提供者:e` [英] Angular in Rails throws an error in production `Error: [$injector:unpr] Unknown provider: e`

查看:81
本文介绍了Angular in Rails在生产中引发错误`Error:[$ injector:unpr]未知提供者: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屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆