Hi. I do not know if I can post Angular-Meteor questions on this form, but looks that there are few questions about this subject. Please let me know if I can’t publish those questions here.
So, let say we need to show filtered tasks on view, first step we got all the list of tasks buy publishing/subscribing:
Publish:
Meteor.publish("tasks", function(options){
return Tasks.find(options);
});
Subscribe:
var allTasks = $meteor.collection(Tasks).subscribe('tasks', {});
And now, let say I need to see in $scope only tasks that have ‘active’ variable set to true.
Something like this:
$scope.active_tasks = getFilteredTasks(allTasks, {active: true})
How do I replace the getFilteredTasks(allTasks, {active: true}) to get tasks that have only active==true variable?
I know that we can set ‘options’ when subscribing to tasks like:
{active: true}
But it isn’t helps to resolve the issue. The goal is to subscribe only once and later use filters to show only part of tasks.
I still not finished the Angular-Meteor tutorial, so it may be explained later, if you can please point me on right tutorial it will greatly speed-up my learning.
Thanks in advance.