Last active
October 17, 2016 14:09
-
-
Save swalters/969d9acb15605f46804f4bbf01590faa to your computer and use it in GitHub Desktop.
Aurelia Childen not working with inlineView
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='./parentComponent'></require> | |
<require from='./childComponent'></require> | |
<p>Should log a count of child components</p> | |
<parent-component> | |
<child-component>one</child-component> | |
</parent-component> | |
</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 = 'Aurelia Template'; | |
activate() { | |
} | |
attached() { | |
} | |
} |
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 {noView, | |
customElement} from 'aurelia-framework'; | |
@customElement('child-component') | |
@noView() | |
export class ChildComponent { | |
} |
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://cdn.rawgit.com/vegarringdal/vGridGistRunJSPMBundle/v.1.0.7/jspm_packages/system.js"></script> | |
<script src="https://cdn.rawgit.com/vegarringdal/vGridGistRunJSPMBundle/v.1.0.7/config.js"></script> | |
<script> | |
System.import('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
import {bindable, | |
inlineView, | |
customElement, | |
children} from 'aurelia-framework'; | |
import {ChildComponent} from './childComponent' | |
@customElement('parent-component') | |
@inlineView(`<template><slot></slot></template>`) | |
export class ParentComponent { | |
@children('child-component') children:ChildComponent[] = []; | |
attached(){ | |
console.log('children Count: ' + this.children.length); | |
} | |
} |
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> | |
<slot></slot> | |
</template> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment