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