Skip to content

Instantly share code, notes, and snippets.

View piuccio's full-sized avatar
:octocat:
Time for a change

Fabio Crisci piuccio

:octocat:
Time for a change
View GitHub Profile
@piuccio
piuccio / console.js
Created February 7, 2013 08:57
hashspace Event listeners on scope objects
// Click on the fruit name toggles the fruit's edible property
@piuccio
piuccio / console.js
Created February 6, 2013 19:16
hashspace Event callbacks as literals
// Event callbacks don't need a refresh, they trigger one automatically
log();
@piuccio
piuccio / console.js
Last active December 12, 2015 05:28
hashspace Foreach loop and json interaction
// 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 December 12, 2015 05:28
hashspace Basic template insert
// 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 December 12, 2015 04:39
hashspace Plain text template with binding modifiers
// 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