Advertisement
Guest User

Untitled

a guest
May 26th, 2015
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. publication:
  2.  
  3. Meteor.publish("productMap", function () {
  4. return ProductMap.find({});
  5. });
  6.  
  7. Subsctiption:
  8.  
  9. Router.map(function () {
  10. this.route('insert', {
  11. path: '/insert',
  12. template: 'insertProduct',
  13. waitOn: function() {
  14. return
  15. Meteor.subscribe('productMap');
  16. }
  17. });
  18. });
  19.  
  20.  
  21. Template helper:
  22.  
  23. Template.insertProduct.helpers({
  24. productList: function() {
  25. productList = ProductMap.find({}).fetch();
  26. console.log(productList)
  27. return productList
  28. }
  29. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement