我使用angular-app的安全功能,并且在 authorizationProvider 中发生了一些时髦的事情
angular.module('security.authorization', ['security.service'])
// You can add them as resolves to routes to require authorization levels
// before allowing a route change to complete
.provider('securityAuthorization', {
requireUser: ['securityAuthorization', function(securityAuthorization) {
return securityAuthorization.requireUser();
}],
$get: ['security', 'securityRetryQueue', function(security, queue) {
var service = {
requireUser: function() {
//Stuff ...
return true;
};
return service;
}]
});
提供者将自己注入到属性“requireUser”中,该属性调用由 $get 工厂方法返回的函数。现在,当我尝试丑化这个(grunt-contrib-uglify)时,它失败了
requireUser: ['securityAuthorization', function(securityAuthorization) {
return securityAuthorization.requireUser();
}]
与Unknown provider: eProvider <- e
. 我怎样才能缩小这个?我已经尝试过替代提供者声明(从 1.1.x 开始,可以像普通工厂一样声明提供者,即注入依赖项并让提供者成为一个函数),但这也不起作用,因为它在security.authorization 模块。