counter.html 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <title>Trapped - Counter example</title>
  5. <style>
  6. [data-trap] {
  7. display: none
  8. }
  9. button {
  10. font-family: monospace;
  11. }
  12. </style>
  13. <meta name="author" content="Herbert Vojčík"/>
  14. <script type='text/javascript' src='../the.js'></script>
  15. <script type="text/javascript">
  16. var blackboard;
  17. require.config({baseUrl: '..'});
  18. require(["app", "trapped-counter/Trapped-Counter"], function (amberPromise) {
  19. Promise.resolve(amberPromise).then(function (amber) {
  20. amber.initialize({
  21. //used for all new packages in IDE
  22. 'transport.defaultAmdNamespace': "trapped-counter"
  23. }).then(function () {
  24. require(["amber-ide-starter-dialog"], function (dlg) { dlg.start(); });
  25. $(function () {
  26. amber.globals.CounterApp._start();
  27. });
  28. });
  29. });
  30. });
  31. </script>
  32. </head>
  33. <body>
  34. <h2 data-trap="TrappedCounter ~value"></h2>
  35. <button data-trap="TrappedCounter: (signal increment) whenClicked">++</button>
  36. <button data-trap="TrappedCounter: (signal decrement) whenClicked">--</button>
  37. </body>
  38. </html>