Skip to content

Instantly share code, notes, and snippets.

@poef
Created December 5, 2018 15:23
Show Gist options
  • Select an option

  • Save poef/355ac0949d593dbc02b75251735f45c7 to your computer and use it in GitHub Desktop.

Select an option

Save poef/355ac0949d593dbc02b75251735f45c7 to your computer and use it in GitHub Desktop.

Revisions

  1. poef created this gist Dec 5, 2018.
    23 changes: 23 additions & 0 deletions index.html
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,23 @@
    <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>