angular.module('app', [
... ])
.constant('AppConstants', constants)
.config(appConfig)
.run((UserService, User) => {
'ngInject';
console.log('apprun')
UserService.acl()
.then((data) => {
console.log('data')
User.setACL(data)
console.log(data)//finsish this first then go to second run call
})
.catch((err) => {
console.log(err);
})
})
.run(appRun)
.component('app', AppComponent)
我需要先完成
Usercervice.acl
调用,然后运行第二个 run(apprun) 方法需要调用这里是代码来自UserService.acl()
让 acl = () => { return $http.get(AppConstants.api +
/acl/user-resources
) .then((res) => { return res.data })
}