Last active
October 7, 2016 00:57
-
-
Save jdanyow/feedfd7659d90c0bdf6d617a244288a6 to your computer and use it in GitHub Desktop.
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="./set-attribute"></require> | |
<input ref="myInput" value="bar"> | |
<div ref="test" foo.bind="myInput.value & setAttribute"></div> | |
<pre><code>${test.outerHTML}</code></pre> | |
</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 { | |
bind() { | |
// this is not required... just cleaning up the output | |
this.test.removeAttribute('ref'); | |
this.test.removeAttribute('class'); | |
this.test.removeAttribute('au-target-id'); | |
this.test.removeAttribute('foo.bind'); | |
} | |
} |
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 {DataAttributeObserver} from 'aurelia-binding'; | |
export class SetAttributeBindingBehavior { | |
bind(binding, source) { | |
binding.targetObserver = new DataAttributeObserver(binding.target, binding.targetProperty); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment