-
-
Save dstroyrofworlds/53ce02fb5b71c349efdb4935d5583489 to your computer and use it in GitHub Desktop.
Aurelia RequireJS Gist
This file contains 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="./xbutton.html"></require> | |
<require from="./listen"></require> | |
<h1>${message}</h1> | |
<xbutton click.bind="click"></xbutton> | |
<listen xxx.two-way="xxx"></listen> | |
</template> |
This file contains 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 App { | |
message = 'Hello World!'; | |
@bindable() xxx = false; | |
click() { | |
console.log('app before' + this.xxx); | |
this.xxx = true; | |
console.log('app after' + this.xxx); | |
} | |
xxxChanged(newValue) { | |
console.log('app - xxx changed to ' + newValue + ' xxx ' + this.xxx); | |
} | |
} |
This file contains 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 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> | |
Show <input type="checkbox" checked.bind="xxx"> | |
</template> |
This file contains 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 ListenCustomElement { | |
@bindable() xxx; | |
constructor() { | |
console.log('listen init'); | |
} | |
xxxChanged(newValue) { | |
console.log('listen - xxx changed to ' + newValue); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment