Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
Time for a change

Fabio Crisci piuccio

:octocat:
Time for a change
View GitHub Profile
@piuccio
piuccio / console.js
Created Feb 7, 2013
hashspace Event listeners on scope objects
View console.js
// Click on the fruit name toggles the fruit's edible property
@piuccio
piuccio / console.js
Created Feb 6, 2013
hashspace Event callbacks as literals
View console.js
// Event callbacks don't need a refresh, they trigger one automatically
log();
@piuccio
piuccio / console.js
Last active Dec 12, 2015
hashspace Foreach loop and json interaction
View console.js
// The model is accessible with the name `vscope`
//
// `json` has also methods to handle arrays
// - push
// - splice
// - shift
json.push(vscope.things, "Mangos");
log();
hsp.refresh();
@piuccio
piuccio / console.js
Last active Dec 12, 2015
hashspace Basic template insert
View console.js
// The model is accessible with the name `vscope`
// To refresh a template, call `refresh()`
json.set(vscope, "message", 'Have a nice refresh.');
log();
hsp.refresh();
@piuccio
piuccio / console.js
Last active Dec 12, 2015
hashspace Plain text template with binding modifiers
View console.js
// 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
You can’t perform that action at this time.