Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angularjs Can';缩小后是否更新角度模块?_Angularjs_Dependency Injection - Fatal编程技术网

Angularjs Can';缩小后是否更新角度模块?

Angularjs Can';缩小后是否更新角度模块?,angularjs,dependency-injection,Angularjs,Dependency Injection,我手动引导我的应用程序,因为我需要首先从外部源获取配置 我覆盖了一个公开常量的配置模块,以便应用程序和引导可以使用它。如果配置的http调用有问题,它将返回已经声明的配置 在我缩小/连接/丑化代码之前,这一切都很正常 你知道为什么吗 代码: angular.module('app.config',[])即使缩小后仍应存在,您可以查看它现在是什么。显示文件的其余部分。听起来好像您没有使用字符串依赖项注入,如果您缩小它,这将导致问题。。请参阅“关于缩小的说明” $http.get('app-conf

我手动引导我的应用程序,因为我需要首先从外部源获取配置

我覆盖了一个公开常量的配置模块,以便应用程序和引导可以使用它。如果配置的http调用有问题,它将返回已经声明的配置

在我缩小/连接/丑化代码之前,这一切都很正常

你知道为什么吗

代码:


angular.module('app.config',[])
即使缩小后仍应存在,您可以查看它现在是什么。显示文件的其余部分。听起来好像您没有使用字符串依赖项注入,如果您缩小它,这将导致问题。。请参阅“关于缩小的说明”
$http.get('app-config.json')
            .then(function (response) {
                //this will overwrite the existing default app.config module and the appConfigConstants object
                angular.module('app.config', []).constant('appConfigConstants', response.data);
                deferred.resolve();
            })
            .catch(function (errorResponse) {

                if (console) {
                    console.warn('Unable to fetch application configuration- using default', errorResponse.status);
                }
            });