I have Collection 2 and autoform installed. And I have the following codes:
Schema:
Schema.ShopList = new SimpleSchema
item:
type: String
label: 'Item Name'
budget:
type: Number
label: 'Budget'
Publish and Subscribe:
if Meteor.isServer
Meteor.publish 'shoplist', -> ShopList.find()
if Meteor.isClient
Meteor.subscribe 'shoplist'
Fixture data:
testItems = [
{ item: 'Foobar', budget: 100 },
{ item: 'Pancake', budget: 200 }
]
routes in Iron-Router
Router.route '/item-details/:_id',
name: 'individualItemPage'
data: -> ShopList.findOne @params._id
Everything works fine in template:
template(name='individualItemPage')
table
tr
td [Item]
td #{item}
tr
td [budget]
td #{budget}
Question: How can I assign the label
of Schema to [Item]
and [Budget]
the template?
I do a lot of trial and errors, and Google Search doesn’t help either. Please teach me.
Many thanks in advance!