Last active
November 10, 2016 16:55
-
-
Save AStoker/bf6949bb5ca3afd6f54cee7f1ae3bad4 to your computer and use it in GitHub Desktop.
Testing out nested shadow dom
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="./customListCustomElement"></require> | |
<custom-list items.bind="tracks"> | |
<template replace-part="title-override">Nothing to see here</template> | |
</custom-list> | |
</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 { | |
tracks = [ | |
{ title: 'Walking on the Sun', content: [ | |
{ | |
lyric:'foo' | |
}, | |
{ | |
lyric:'bar' | |
} | |
] | |
}, | |
{ title: 'All Star', content: [ | |
{ | |
lyric:'boo' | |
}, | |
{ | |
lyric:'blah' | |
} | |
] | |
} | |
] | |
} |
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> | |
<div repeat.for="item of items"> | |
<div replaceable part="title-template">${item.title}</div> | |
<div replaceable part="content-template" repeat.for="line of item.content"> | |
${$index + 1}. ${line.lyric} | |
</div> | |
</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
import { bindable, computedFrom } from 'aurelia-framework'; | |
export class CustomList2CustomElement { | |
@bindable items; | |
bind(){ | |
console.log('customList2'); | |
console.log(this.items); | |
} | |
} |
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="./customList2CustomElement"></require> | |
<custom-list2 items.bind="items"> | |
<template replace-part="title-template"> | |
<div replaceable part="title-override">Song: ${item.title}</div> | |
</template> | |
</custom-list2> | |
</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, computedFrom } from 'aurelia-framework'; | |
export class CustomListCustomElement { | |
@bindable items; | |
bind(){ | |
console.log('customList'); | |
console.log(this.items); | |
} | |
} |
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> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment