-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tutorial: Load dependencies in cards.
- Loading branch information
Showing
1 changed file
with
14 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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!" })); | ||
} | ||
}); |