定义控制器的配置函数:
function config($stateProvider){
$stateProvider
.state('games', {
url: '/games',
templateUrl: 'client/games/games.ng.html',
controller: 'Games',
controllerAs: 'vm'
});
}
我的控制器:
function GamesController($scope, $meteor, Engine) {
var vm = this;
vm.selectedMove = { _id: 'dsfsdf'}
vm.evaluations = $meteor.collection(Evaluations),
$meteor.subscribe('evaluations', {}, $scope.getReactively('vm.selectedMove')._id).then(function(){
console.log(vm.evaluations);
});
}
我收到一条错误消息:“无法读取未定义的属性 '_id'”,它指向这一行:'$scope.getReactively('vm.selectedMove')._id).then...'
我究竟做错了什么?提前致谢!