-
-
Save arjanvanderleden/0efbaea028450163d98e to your computer and use it in GitHub Desktop.
Aurelia repeat.for binding on a 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
<template> | |
<require from="./menu-item"></require> | |
<div>${message}</div> | |
<div>menu Items : ${menuItems.length}</div> | |
<ul> | |
<li repeat.for="item of menuItems">${item.label}</li> | |
</ul> | |
<ul> | |
<menu-item repeat.for="item of menuItems" containerless ></menu-Item> | |
</ul> | |
<ul> | |
<menu-item repeat.for="item of menuItems" containerless current.bind="item"></menu-Item> | |
</ul> | |
</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 {MenuItem} from 'menu-item' | |
export class App { | |
message = 'hello world'; | |
menuItems = []; | |
constructor(){ | |
this.menuItems.push(new MenuItem("Home")); | |
this.menuItems.push(new MenuItem("About")); | |
this.menuItems.push(new MenuItem("Contact")); | |
console.log('app constructor'); | |
} | |
attached(){ | |
console.log('app = 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
<!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/jdanyow/aurelia-bundle/v1.0.3/jspm_packages/system.js"></script> | |
<script src="https://cdn.rawgit.com/jdanyow/aurelia-bundle/v1.0.3/config.js"></script> | |
<script> | |
System.import('aurelia-bootstrapper'); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment