Skip to content

Commit

Permalink
Tutorial: Load dependencies in cards.
Browse files Browse the repository at this point in the history
  • Loading branch information
hjdivad authored and cyril-sf committed Dec 13, 2013
1 parent de9e919 commit 0a18ac0
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions example/cards/tutorial/survey_card.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
/*global Handlebars*/

Conductor.require('/vendor/jquery.js');
Conductor.require('/example/libs/handlebars-1.0.0-rc.3.js');

var template = '<div>{{message}}</div>';

Conductor.card({

activate: function( data ) {
this.message = "<div>hello world</div>";
this.compileTemplates();
},

compileTemplates: function() {
template = Handlebars.compile(template);
},

render: function () {
document.body.innerHTML = this.message;
$('body').html(template({ message: "Hello again, world!" }));
}
});

0 comments on commit 0a18ac0

Please sign in to comment.