Heroku上的Rails + +角=未知提供商:eProvider&LT; - 电子 [英] Heroku + Rails + Angular = Unknown provider: eProvider <- e
问题描述
感觉完全莫名其妙。我知道的几个问题已经问这件事,我都看了又看他们。
Feeling completely baffled. I know that several questions have been asked about this and I've read and reread all of them.
角(含伍路由)的工作,直到一定的承诺(我将包含js文件的差异文件,图像)。我已经改变了我本来预计是有罪的一方,如下所示:
Angular (with ng-route) was working until a certain commit (I'll include images of the diffs of the js files). I've already changed what I would have expected to be the guilty party, shown here:
改变了这种
app.run(function($rootScope, $http){
$rootScope.logout = function(){
$http({
url: 'logout',
method: 'GET'
}).success(function(data){
window.location = window.location.href;
});
};
});
这个
app.run(['$rootScope', '$http', function($rootScope, $http){
$rootScope.logout = function(){
$http({
url: 'logout',
method: 'GET'
}).success(function(data){
window.location = window.location.href;
});
};
}]);
不过,即使我完全犯了上述code中的错误仍然存在,所以我真的不认为这是它。我也通过code和没有大块注释掉大块似乎解决了这个问题。
However, even if I completely commit out the above code the error still persists, so I really don't think that's it. I've also commented out chunk by chunk of code and nothing seems to resolve this issue.
我已经把它贴在展示在提交文件中的差异的图像。在此之前提交,棱角分明是在Heroku /生产工作的罚款。我只是傻与不去看吗?
I've attached an image showing the diff in the commit file. Before this commit, angular was working fine on Heroku/production. Am I just being stupid and not seeing it?
http://imgur.com/SwsEeuH,oITUoY7,bQ8HKrj,tZF4HMS
在此先感谢!
推荐答案
您,当您使用JavaScript minifier的轧液一个角度依赖性得到这样的错误。由于角度看上去依赖了通过参数名无法找到他们。
You get this kind of error when you use a JavaScript minifier that mangles a Angular dependency. Because Angular looks dependency up by argument name it can't find them.
我不知道你使用的是什么来构建你的JavaScript成精缩和合并的文件,但你需要找出一个办法在角友好的方式来做到这一点。我有一个项目,最近,使用了 ngmin
咕噜插件minifier我的JavaScript开始,直到我切换到 NG-注释得到类似的错误
。
I'm not sure what you are using to build your JavaScript into minified and merged files but you'll need to work out a way to do this in an Angular friendly way. I had a project recently that used the ngmin
grunt plugin to minifier my JavaScript and started to get similar errors until I switched to ng-annotate
.
这篇关于Heroku上的Rails + +角=未知提供商:eProvider&LT; - 电子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!