3
我只是把我的程序上的Heroku和页面我测试的角度载有下面的错误:无法实例化模块生产
未捕获的错误:[$注射器:modulerr]未能实例化模块diceAngularApp由于: 错误:[$ injector:unpr]未知提供者:t
它在开发过程中工作得很好,所以我不确定问题会出在哪里。要查看错误,您可以访问www.firexion.com/dice页面
我不确定问题的确切位置,因此我不确定要分享哪个代码。这里的链接到github上吧:https://github.com/Firexion/hundred
我猜它可能是在角app.js也许?:
'use strict';
angular
.module('diceAngularApp', [
'ngCookies',
'ngResource',
'ngSanitize',
'ngRoute'
])
.config(function ($routeProvider) {
$routeProvider
.when('/dice', {
templateUrl: '../../views/dice/main.html',
controller: 'DiceController'
})
.otherwise({
redirectTo: '/dice'
});
});
也许我把它错在我的Rails应用程序的JavaScript文件,管腔.js:
// Lumen
// Bootswatch
//= require jquery-2.1.0
//= require jquery_ujs
//= require lumen/loader
//= require lumen/bootswatch
// angular
//= require angular/angular
//= require angular/angular-cookies
//= require angular/angular-resource
//= require angular/angular-route
//= require angular/angular-sanitize
//= require angular/angular-scenario
// dice
//= require dice/app.js
//= require dice/controllers/main.js
//= require dice/dice.js
非常感谢您提供任何帮助。
好的,我一直在试图跟随,我“认为”我的app.js已经正确设置,以防止这种情况?你没错,我没有说出任何名字。它看起来像试图将$ routeProvider引用为t,并且据我所知,我没有正确传递它。很困惑。我认为我没有设置任何东西来缩小这个,也许这是heroku为你做的事情? – firexion
哦,看起来像rails有一个默认设置,使用uglifier在生产上进行压缩,而不是dev。看来这可能是缩小的罪魁祸首,但我仍然不确定我的app.js和main.js有什么问题导致提供程序无法通过缩小器,因为我不认为它被变量引用任何地方 – firexion
好吧,我只是要写这一个糟糕的一天。我试图关闭uglifier并将它推到heroku,没有任何东西。把它拉回来,注意到我忘记了我的一个控制器功能中的乘法。我想我可能会推动这个变化到heroku,导致为什么不,突然之间页面完美工作?我不明白,但它的工作,我非常感谢你的建议与缩小 – firexion