Last active
February 22, 2018 10:29
-
-
Save dtaalbers/40dcf861e75857e7ab2aaa702cf1afb4 to your computer and use it in GitHub Desktop.
Aurelia Child Components
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='board'></require> | |
<require from='boardlane'></require> | |
<board> | |
<boardlane></boardlane> | |
<boardlane></boardlane> | |
<boardlane></boardlane> | |
</board> | |
</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 { | |
title = 'Custom Element with Slot' | |
} |
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 class="body"> <slot></slot> </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 { customElement, children } from 'aurelia-framework'; | |
@customElement('board') | |
@children({ name: 'lanes', selector: 'boardlane' }) | |
export class BoardComponent { | |
lanes = []; | |
attached() { | |
console.log('lanes', this.lanes) | |
} | |
} |
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 class="body"> Lane </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 { customElement } from 'aurelia-framework'; | |
@customElement('boardlane') | |
export class BoardLaneComponent { | |
} |
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"> | |
<style> | |
.panel { | |
border: 1px solid black; | |
} | |
.panel-heading { | |
background: lightblue; | |
color: white; | |
border-bottom: 1px solid black; | |
padding: 3px; | |
font-size: 20px; | |
} | |
.panel-body { | |
padding: 3px; | |
} | |
</style> | |
</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