Metor-angular getting undefined while binding collection data


#1

Hello, I’m doing my first application in meteor, and for now I want to load first element collection into $scope, and run logic based on results, however, if assigning method is called before collection is loaded, my variable becomes undefined and application is stuck. This is how I do it now:

$scope.thingsList = $meteor.collection(ThingsList).subscribe('ThingsList');
$scope.list = $scope.thingsList[0];
console.log($scope.list);   // returns undefined     

Please tell me, how to work my way around this problem?