Skip to content

Instantly share code, notes, and snippets.

@teaplanet
Created December 23, 2014 07:33
Show Gist options
  • Select an option

  • Save teaplanet/36f39886d8c034242c76 to your computer and use it in GitHub Desktop.

Select an option

Save teaplanet/36f39886d8c034242c76 to your computer and use it in GitHub Desktop.
Ractive.js Tutorial 1-3
<!-- http://learn.ractivejs.org/hello-world/3 -->
<script src='http://cdn.ractivejs.org/latest/ractive.min.js'></script>
<div id='container'></div>
<script id='template' type='text/ractive'>
<p>{{greeting}} {{name}}!</p>
</script>
var ractive = new Ractive({
el: 'container',
template: '#template',
data: { greeting: 'Hello', name: 'world' }
});
ractive.set('greeting', 'Bonjour');
ractive.set('name', 'tout le monde');
ractive.set({
greeting: '你好',
name: '世界'
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment