Angular.module 缩小错误 [英] Angular.module minification bug

查看:31
本文介绍了Angular.module 缩小错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

花最宝贵的时间试图找出缩小不起作用的原因.

Having the darnedest time trying to figure out why minification is not working.

根据网络上的众多建议,我已经通过数组对象在函数之前注入了我的提供者,但仍然未知提供者:aProvider <- a"

I have injected via an array object my providers prior the function per numerous suggestions across the web and yet still "Unknown provider: aProvider <- a"

常规:

var app = angular.module('bpwApp', ['ui.bootstrap', 'ui', 'myTabs'])
    .config(['$routeProvider', '$locationProvider', function($routeProvider, $locationProvider){
    $routeProvider.
        when('/', {templateUrl: 'partials/home.jade', controller: HomeCtrl});

    $locationProvider.html5Mode(true);
    }])

缩小:

var app = angular.module('bpwApp', ['ui.bootstrap', 'ui', 'myTabs'])
    .config(['$routeProvider', '$locationProvider', function(a, b){
    a.
        when('/', {templateUrl: 'partials/home.jade', controller: HomeCtrl});

    b.html5Mode(true);
    }])

非常感谢任何建议!

推荐答案

ng-min的AndrewM96建议是对的.

AndrewM96 suggestion of ng-min is right.

对齐和空白对 Uglify 和 Angular 都很重要.

The alignment and white space matters to Uglify as well as Angular.

这篇关于Angular.module 缩小错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆