rivets showTable
HTML
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<script src="https://raw.githubusercontent.com/mikeric/rivets/v0.8.0/dist/rivets.bundled.min.js"></script>
<div id="main">
<div>
<button rv-on-click="toggle">
Toggle
</button>
</div>
<div>
Table sould be visible: {showTable}
</div>
<table rv-show="showTable" >
<tbody>
<tr rv-each-item="items">
<td>{item.name}</td>
</tr>
<tbody>
</table>
</div>
JavaScript
$(function(){
var rvcontext = {};
var rview = rivets.bind($("#main"), rvcontext);
rvcontext.showTable = true;
rvcontext.items = [
{
name : "Foo"
},{
name : "Bar"
},{
name : "Baz"
}
];
rvcontext.toggle = function(){
rvcontext.showTable = !rvcontext.showTable;
}
});