diff --git a/example/cards/tutorial/survey_card.js b/example/cards/tutorial/survey_card.js index dedfee4..3341a6a 100644 --- a/example/cards/tutorial/survey_card.js +++ b/example/cards/tutorial/survey_card.js @@ -1,9 +1,21 @@ +/*global Handlebars*/ + +Conductor.require('/vendor/jquery.js'); +Conductor.require('/example/libs/handlebars-1.0.0-rc.3.js'); + +var template = '
{{message}}
'; + Conductor.card({ + activate: function( data ) { - this.message = "
hello world
"; + this.compileTemplates(); + }, + + compileTemplates: function() { + template = Handlebars.compile(template); }, render: function () { - document.body.innerHTML = this.message; + $('body').html(template({ message: "Hello again, world!" })); } });