Last active
September 26, 2017 14:39
-
-
Save AshleyGrant/864edc684eb107cdd71c58785b14d2f9 to your computer and use it in GitHub Desktop.
Aurelia Calls Function
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="./calls-function"></require> | |
| <calls-function passed-in-function.call="myFunc(paramOne, paramTwo)"></calls-function> | |
| Text: ${text}<br /> | |
| </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 { | |
| myFunc(paramOne, paramTwo) { | |
| this.text = `paramOne: ${paramOne}, paramTwo: ${paramTwo}`; | |
| } | |
| } |
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> | |
| <div> | |
| <div> | |
| First Name: | |
| <input type="text" value.bind="firstName" /> | |
| </div> | |
| <div> | |
| Last Name: | |
| <input type="text" value.bind="lastName" /> | |
| </div> | |
| <button click.trigger="doStuff()">Do Stuff</button> | |
| </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
| import {bindable} from 'aurelia-framework'; | |
| export class CallsFunction { | |
| @bindable passedInFunction; | |
| doStuff() { | |
| this.passedInFunction({ paramOne: this.firstName, paramTwo: this.lastName }); | |
| } | |
| } |
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 {inject} from 'aurelia-framework'; | |
| @inject(Element) | |
| export class KeyboardCustomAttribute { | |
| constructor(el) { | |
| this.el = el; | |
| } | |
| attached() { | |
| $(this.el).keyboard({ | |
| layout: 'qwerty' | |
| }) | |
| // activate the typing extension | |
| .addTyping({ | |
| showTyping: true, | |
| delay: 250 | |
| }); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment