Skip to content

Instantly share code, notes, and snippets.

@poef
Created December 5, 2018 15:23
Show Gist options
  • Save poef/355ac0949d593dbc02b75251735f45c7 to your computer and use it in GitHub Desktop.
Save poef/355ac0949d593dbc02b75251735f45c7 to your computer and use it in GitHub Desktop.
A very basic web app using SimplyView
<div id=”counterApp”>
<input type=”text” data-simply-field=”counter”>
<button data-simply-command=”add1">+</button>
<button data-simply-command=”sub1">-</button>
<div>Counter is now: <span data-simply-field=”counter”></span></div>
</div>
<script src=”/js/simply.everything.js”></script>
<script>
var counterApp = simply.app({
container: document.getElementById(‘counterApp’),
commands: {
add1: function() {
counterApp.view.counter++;
},
sub1: function() {
counterApp.view.counter — ;
}
},
view: {
counter: 1
}
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment