I’m currently trying to build very simple apps with the Meteor/Angular combination, and I’m especially struggling with getting the publish/subscribe part working. My frontend knowledge is pretty limited, but I’m not a full beginner (basic experience with HTML/JS/CSS and Angular). Please assume for this topic that I won’t use a different combination of frameworks, even if they would be easier to learn or integrate with Meteor.
So far I’ve managed to create a collection and publish it (server side), calling Meteor.methods from the client component (which subscribes to the collection) and succesfully inserting entries into the database (which I’m checking in my meteor mongo console). So far so good.
My main problem now is figuring out how to retrieve that data in my client side component and displaying it in HTML through Angular’s functionality. Most examples/tutorials I’ve found so far seem to work with React, Blaze, etc., or they do use Angular but either don’t explain much or they are more advanced level (so still not explaining the more basic concepts). I’m struggling because I know some isolated parts of the problem like how to use ngFor to loop over items, but then I don’t know how to make it work with Meteor’s MyCollection.find().fetch() in such a way that I have a return type that I can manipulate, display and/or loop over.
To make it a bit more concrete, currently I’m just trying to get a basic list displayed in the HTML, something like:
Ducks:
- Fred (likes bread)
- Lisa (likes swimming)
- Bob (likes sleeping)
which I would be using syntax like this for:
- {{ duck.name }} (likes {{ duck.favoriteThing }})