angular-meteor
angular-meteor copied to clipboard
$meteor.autorun and $scope.getReactively not getting full reactivity
I'm prototyping this and the search functionality involves an address and many other properties all baked into a single object called searchFodder. I'm trying to listen for user changes and update results reactively (yes exactly like Angular ng-repeat filters) via $meteor.autorun(...):
$meteor.autorun($scope, function(){
$scope.$meteorSubscribe('listings', $scope.getReactively('searchFodder', true)).then(function( handler ) {
// if user provided an address
console.log($scope.searchFodder);
$scope.filteredListings = $meteor.collection( Listings ); // filteredListings will be rendered into DOM via ng-repeat
// else ensure that $scope.filteredListings is empty
console.log($scope.searchFodder);
});
});
when I begin filling out the search criteria I see no changes initially. Only when I enter an address then clear it does it show the changes persisting in the model. How do I ensure that every time a user provides an address and filters the code gets run?