Ractive.js with Bootstrap example
HTML
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/ractive"></script>
<div id='container'></div>
<script id="templateOne" type="x-template">
aPartial:{{>aPartial}}
</script>
JavaScript
var ractive = new Ractive({
el:"#container",
template: '#templateOne',
partials: {
aPartial: '<div>Oh look, the aPartial is rendered!</div>'
}
});
function cb() {
alert('cb run. now we unrendered');
ractive.once('complete', function() {
alert('rerendered, once complete 2');
});
ractive.render('container');
}
//ractive.partials.part = '<div>this is a partial</div>';
ractive.once('complete', function() {
alert('init render, once complete 1, now will unrender');
ractive.unrender().then(cb);
});
//ractive.render('container');