-
-
Save AshleyGrant/f5a165c276274f868256f0a849c55b8c to your computer and use it in GitHub Desktop.
Aurelia 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="stringify"></require> | |
<h1>${message}</h1> | |
<div repeat.for="i of arr"> | |
i = ${i} | |
<br/> | |
$parent.message = ${$parent.message} | |
<br/> | |
$parent.someVar = ${$parent.someVar} | |
<br/> | |
$parent = ${$parent} | |
<br/> | |
$parent.message with conveter = ${$parent.message | stringify} | |
<br/> | |
$parent.someVar with conveter = ${$parent.someVar | stringify} | |
<br ref="temp" parent.bind="$parent"/> | |
<!-- | |
uncomment this to show the buggy behaviour --> | |
$parent with conveter = ${ temp.parent | stringify} | |
</div> | |
</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
export class App { | |
message = 'Hello World!'; | |
someVar = {a: 12}; | |
arr = [1] | |
} |
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
export class stringifyValueConverter | |
{ | |
toView(obj) | |
{ | |
return "Converted " + (obj && JSON.stringify(obj)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment