Created
May 21, 2017 17:07
-
-
Save AshleyGrant/89d8fea52401625c0e26cae977060967 to your computer and use it in GitHub Desktop.
D3 + Aurelia
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <template> | |
| <require from="./pager"></require> | |
| <div pager="numberOfPages.bind: numberOfPages">Number of pages: ${numberOfPages}</div> | |
| </template> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export class App { | |
| numberOfPages = 0; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!doctype html> | |
| <html> | |
| <head> | |
| <title>Aurelia</title> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| </head> | |
| <body aurelia-app> | |
| <h1>Loading...</h1> | |
| <script src="https://jdanyow.github.io/rjs-bundle/node_modules/requirejs/require.js"></script> | |
| <script src="https://jdanyow.github.io/rjs-bundle/config.js"></script> | |
| <script src="https://jdanyow.github.io/rjs-bundle/bundles/aurelia.js"></script> | |
| <script src="https://jdanyow.github.io/rjs-bundle/bundles/babel.js"></script> | |
| <script> | |
| require(['aurelia-bootstrapper']); | |
| </script> | |
| </body> | |
| </html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import {bindable, bindingMode, computedFrom} from 'aurelia-framework'; | |
| export class PagerCustomAttribute { | |
| totalPages = 0; | |
| constructor() { | |
| setInterval(() => { | |
| console.log('setting totalpages'); | |
| this.totalPages++ | |
| }, 1000); | |
| } | |
| get numberOfPages() { | |
| return this.totalPages | |
| } | |
| @bindable({defaultBindingMode: bindingMode.twoWay}) | |
| set numberOfPages(value) { | |
| console.log('setting numberofPages') | |
| this.totalPages = value; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment