{"push_id":984421505,"size":1,"distinct_size":1,"ref":"refs/heads/master","head":"5672c6076123a2035be6421bfa222e17ae046617","before":"1e28c3d3fda5048ee22649eb1217456b99653a6f","commits":[{"sha":"5672c6076123a2035be6421bfa222e17ae046617","author":{"email":"79a5a865df5de11a4825a0c5d74090afc5ca824e@gmail.com","name":"Richard Wang"},"message":"Defining views with templates\n\nHTML files in Meteor define templates\n\nMeteor parses all of the HTML files in your app folder and identifies three top-level tags: <head>, <body>, and <template>.\n\nEverything inside any <head> tags is added to the head section of the HTML sent to the client, and everything inside <body> tags is added to the body section, just like in a regular HTML file.\n\nEverything inside <template> tags is compiled into Meteor templates, which can be included inside HTML with {{> templateName}} or referenced in your JavaScript with Template.templateName.\n\nAdding logic and data to templates\n\nAll of the code in your HTML files is compiled with Meteor's Spacebars compiler. Spacebars uses statements surrounded by double curly braces such as {{#each}} and {{#if}} to let you add logic and data to your views.\n\nYou can pass data into templates from your JavaScript code by defining helpers. In the code above, we defined a helper called tasks on Template.body that returns an array. Inside the body tag of the HTML, we can use {{#each tasks}} to iterate over the array and insert a task template for each value. Inside the #each block, we can display the text property of each array item using {{text}}.\n\nIn the next step, we will see how we can use helpers to make our templates display dynamic data from a database collection.","distinct":true,"url":"https://api.github.com/repos/wangleihd/meteor-todo/commits/5672c6076123a2035be6421bfa222e17ae046617"}]}