这是我的决心:
.when('/chat', {
templateUrl: 'chat.html',
controller: 'ChatController',
resolve: {
currentUser: ['Auth', function (Auth) {
return Auth.$requireSignIn(true);
}],
messages: ['$firebaseArray', function ($firebaseArray) {
return $firebaseArray(firebase.database().ref('messages')).$loaded();
}],
userList: ['$firebaseArray', function ($firebaseArray) {
return $firebaseArray(firebase.database().ref('online')).$loaded();
}]
}
})
messages
和userList
需要身份验证,那么只有在messages
结算后才能解决userList
和currentUser
?