Skip to content

Instantly share code, notes, and snippets.

@valichek
Forked from jdanyow/app.html
Last active June 15, 2016 13:14
Show Gist options
  • Save valichek/41b17ba5793844b1327aba09f3141352 to your computer and use it in GitHub Desktop.
Save valichek/41b17ba5793844b1327aba09f3141352 to your computer and use it in GitHub Desktop.
Default slot content is not rendered when content of component is empty issue
<template>
<require from="./custom"></require>
<h2>Example 1: (rendered)</h2>
<custom>
<div slot="first">
<p>First slot</p>
</div>
</custom>
<h2>Example 2: (bug here)</h2>
<custom></custom>
<h2>Example 3: (rendered)</h2>
<custom>
<!--comment here-->
</custom>
</template>
export class App {
}
<template>
<slot name="first">
<p>First slot default</p>
</slot>
<slot name="second">
<p>Second slot default</p>
</slot>
</template>
export class Custom {
}
<!doctype html>
<html>
<head>
<title>Aurelia</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<style>
registration-form {
display: block;
max-width: 300px;
margin-left: auto;
margin-right: auto;
}
</style>
</head>
<body aurelia-app="main">
<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>
export function configure(aurelia) {
aurelia.use
.standardConfiguration()
.developmentLogging();
aurelia.start().then(() => aurelia.setRoot());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment