Last active
December 12, 2015 04:39
-
-
Save piuccio/4716236 to your computer and use it in GitHub Desktop.
hashspace Plain text template with binding modifiers
This file contains hidden or 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
// In this console you can interact with the model | |
// without causing a recompilation of the template | |
// | |
// The model is accessible with the name `vscope` | |
// You can display it calling `log()` | |
// You can interact with it using the `json` helper | |
// To refresh a template, call `refresh()` | |
// | |
// Try for instance the following code | |
// Hint: Press Ctrl+Space to execute it | |
log('Before json.set'); | |
json.set(vscope.person, 'name', 'James'); | |
json.set(vscope.person, 'age', 40); | |
log('After json.set'); | |
hsp.refresh(); |
This file contains hidden or 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
var friend = { | |
name : 'Peter', | |
age : 30 | |
}; | |
# template welcome(person) | |
Hello {person.name}, you're {:person.age} years old and you're age won't change | |
# /template | |
// In this file you can have multiple templates or JavaScript object | |
// this line tells the editor which template should be displayed in the output panel | |
// and what are its arguments (second parameter should be an array) | |
display(welcome, [friend]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment