无法在生产中实例化模块
我只是把我的程序推到了heroku上,我测试的角度加载了以下错误:
未捕获错误:[$ injector: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文件中包含错误,lumen.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
感谢您提供的任何帮助。
我强烈怀疑,基于Angular正在寻找变量t的提供者的事实,我猜你不会命名服务/控制器等。 是你正在使用缩小/编译器来破坏你的变量。
要解决这个问题并使用编译器安全,您需要调整语法。 这里有详细信息,但下面是瘦。
myapp.config(['$routeProvider', function($routeProvider) { $routeProvider.when('hello/:queryId', { templateUrl: 'mypartial.html', controller: MyCtrl, controllerAs: 'myCtrl', resolve: { 'myParam': ['myService', '$route', function(myService, $route) { return myService.get($route.current.params.queryId); }] } });
- 防止某些DOM层次结构中的AngularJS插值
- angular-rails-templates:找不到模板
- 如何从运行在不同端口上的本地AngularJS应用程序向本地Rails应用程序发出请求?
- XMLHttpRequest请求的资源上没有“Access-Control-Allow-Origin”标头
- 这对于sinatra + angular.js +自定义提供程序的Oauth2工作流的概念是否正确?
- AngularJS Restful Routing
- Rails上的角度模板
- Javascript错误未知提供者:在Rails缩小Angularjs之后的tProvider < – t
- rails + angularjs在编辑时将值加载到文本字段中