Last active
May 30, 2017 07:36
-
-
Save ZoolWay/5d7ca81605e8492b03ec859937c4149a to your computer and use it in GitHub Desktop.
Aurelia KeyUp
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> | |
<h1>Aurelia KeyUp/Down</h1> | |
<div> | |
<h2>KeyUp:</h2> | |
<div style="border:1px solid blue; padding: 1em; margin: 1em;" keyup.delegate="handleKeyUp($event)"> | |
<input value.bind="myText & debounce:800" placeholder="type here" /> | |
</div> | |
<div style="border:1px solid black; padding: 1em; margin: 1em;"> | |
output: ${myText} | |
</div> | |
</div> | |
<div> | |
<h2>KeyDown:</h2> | |
<div style="border:1px solid blue; padding: 1em; margin: 1em;" keydown.delegate="handleKeyDown($event)"> | |
<input value.bind="myText2 & debounce:800" placeholder="type here" /> | |
</div> | |
<div style="border:1px solid black; padding: 1em; margin: 1em;"> | |
output: ${myText2} | |
</div> | |
</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 { observable } from 'aurelia-framework' | |
export class App { | |
myText = ''; | |
myText2 = ''; | |
handleKeyUp(ev) { | |
console.log('up', ev); | |
} | |
handleKeyDown(ev) { | |
console.log('down', ev); | |
return true; | |
} | |
} |
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="main"> | |
<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
export function configure(aurelia) { | |
aurelia.use.standardConfiguration(); | |
aurelia.start().then(() => aurelia.setRoot()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment