我使用了一个名为django压缩机的自动缩小工具。然而,django压缩机缩小似乎会引入错误。django压缩机的缩小误差
用分号更新脚本:
前:
var app = angular.module('loginApp', [
"ngRoute",
"ngAnimate",
"ngTouch",
"mobile-angular-ui",
"ui.router",
"app.factories.storage",
"app.controllers.login",
"angular-loading-bar"
]);
app.config(function ($stateProvider, $urlRouterProvider) {
// For any unmatched url, send to /route1
$urlRouterProvider.otherwise("/");
$stateProvider
.state('login', {
url: "/",
templateUrl: "/static/html/profile/login.html",
controller: "loginController"
})
.state('register', {
url: "/register",
templateUrl: "/static/html/profile/register.html",
controller: "loginController"
});
});
后:
var app=angular.module("loginApp",["ngRoute","ngAnimate","ngTouch","mobile-angular-ui","ui.router","app.factories.storage","app.controllers.login","angular-loading-bar"]);app.config(function(e,t){t.otherwise("/");e.state("login",{url:"/",templateUrl:"/static/html/profile/login.html",controller:"loginController"}).state("register",{url:"/register",templateUrl:"/static/html/profile/register.html",controller:"loginController"})})
错误:
Error: $injector:modulerr
Module Error
Module 'loginApp' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
错误网址:
https://docs.angularjs.org/error/$injector/modulerr...
更新:看来Django的压缩机不是问题,甚至使用在线工具还是给了同样的错误...... ** ** http://jscompress.com/
的结果unminify =没有错误,缩小=错误
这是什么似乎产生错误:
app.config(function(e,t){t.otherwise("/");e.state("login",{url:"/",templateUrl:"/static/html/profile/login.html",controller:"loginController"}).state("register",{url:"/register",templateUrl:"/static/html/profile/register.html",controller:"loginController"})})
你使用什么版本的角? – yuvi 2014-08-28 10:48:14
@yuvi我正在使用1.2.19 – Prometheus 2014-08-28 10:50:10
这实际上很奇怪。错误的描述似乎适合[nomod错误]的模板(https://docs.angularjs.org/error/$injector/nomod)而不是'$ injector:modulerr' ...你有' ngRoute'安装? – yuvi 2014-08-28 10:50:17