Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- publication:
- Meteor.publish("productMap", function () {
- return ProductMap.find({});
- });
- Subsctiption:
- Router.map(function () {
- this.route('insert', {
- path: '/insert',
- template: 'insertProduct',
- waitOn: function() {
- return
- Meteor.subscribe('productMap');
- }
- });
- });
- Template helper:
- Template.insertProduct.helpers({
- productList: function() {
- productList = ProductMap.find({}).fetch();
- console.log(productList)
- return productList
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement