1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <!doctype html>
- <html>
- <head>
- <title>Trapped - Counter example</title>
- <style>
- [data-trap] {
- display: none
- }
- button {
- font-family: monospace;
- }
- </style>
- <meta name="author" content="Herbert Vojčík"/>
- <script type='text/javascript' src='../the.js'></script>
- <script type="text/javascript">
- var blackboard;
- require.config({baseUrl: '..'});
- require(["app", "trapped-counter/Trapped-Counter"], function (amberPromise) {
- Promise.resolve(amberPromise).then(function (amber) {
- amber.initialize({
- //used for all new packages in IDE
- 'transport.defaultAmdNamespace': "trapped-counter"
- }).then(function () {
- require(["amber-ide-starter-dialog"], function (dlg) { dlg.start(); });
- $(function () {
- blackboard = amber.globals.TrappedCounter._new();
- amber.globals.Trapped._start_([blackboard]);
- });
- });
- });
- });
- </script>
- </head>
- <body>
- <h2 data-trap="TrappedCounter ~value"></h2>
- <button data-trap="TrappedCounter: (signal increment) whenClicked">++</button>
- <button data-trap="TrappedCounter: (signal decrement) whenClicked">--</button>
- </body>
- </html>
|