Skip to content

Instantly share code, notes, and snippets.

@poef
Created December 5, 2018 15:23
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
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