Skip to content

Instantly share code, notes, and snippets.

@hadijaveed
Created October 18, 2016 20:11
Show Gist options
  • Save hadijaveed/73bd96b26e0336494826ec1bd4a09f28 to your computer and use it in GitHub Desktop.
Save hadijaveed/73bd96b26e0336494826ec1bd4a09f28 to your computer and use it in GitHub Desktop.
let counter = new ReactiveHbs({
container: '.mount', // html template mount point
template: '#tpl', // hadnlebars template
data: {
count: 0
}
});
// Events
counter.events({
'click [name="increment-count"]': (e, elm, tpl) => {
tpl.set( 'count', tpl.get('count') + 1 );
}
});
counter.render();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment