我使用了一個名爲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