Skip to content

Instantly share code, notes, and snippets.

@djedi
Last active October 27, 2017 23:30
Show Gist options
  • Save djedi/309e70636b4e11650f08bf230a72164f to your computer and use it in GitHub Desktop.
Save djedi/309e70636b4e11650f08bf230a72164f to your computer and use it in GitHub Desktop.
More slots
<template>
<require from="./nav"></require>
<nav href="#">One</nav>
<nav>Two</nav>
<nav href="#">Three</nav>
<nav>Four</nav>
</template>
export class App {
}
<!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>
<template>
<a href.bind="href" show.bind="href">
<template replaceable part="content"></template>
</a>
<span show.bind="!href">
<template replaceable part="content"></template>
</span>
</template>
import {processContent, bindable} from 'aurelia-framework';
@processContent((compiler, resources, node, instruction) => {
node.innerHTML = `<template replace-part="content">${node.innerHTML}</template>`;
return true;
})
export class Nav {
@bindable href;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment