Created
April 19, 2016 14:47
-
-
Save niieani/15f1178b58928911d5c879878284b405 to your computer and use it in GitHub Desktop.
Aurelia: Suboptimal repeat element lifecycle [alternative without compose + diff + temp]
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="./component"></require> | |
<input type="checkbox" ref="isFiltering"> | |
<br> | |
<component | |
repeat.for="id of components | without8: isFiltering.checked | diff: proxy" | |
id.bind="id" | |
></component> | |
</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 {inlineView, bindable} from 'aurelia-framework' | |
@inlineView('<template>${id}<br></template>') | |
export class Component { | |
@bindable id | |
bind() { | |
console.log('bind', this.id) | |
} | |
unbind() { | |
console.log('unbind', this.id) | |
} | |
} |
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> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment