Skip to content

Instantly share code, notes, and snippets.

@bojanv55
Last active August 31, 2021 08:32
Show Gist options
  • Save bojanv55/031eb55ebce9c7e954257a2a5eabd5a7 to your computer and use it in GitHub Desktop.
Save bojanv55/031eb55ebce9c7e954257a2a5eabd5a7 to your computer and use it in GitHub Desktop.
aurelia 2 compose problem
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Dumber Gist</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no">
<base href="/">
</head>
<!--
Dumber Gist uses dumber bundler, the default bundle file
is /dist/entry-bundle.js.
The starting module is pointed to "main" (data-main attribute on script)
which is your src/main.ts.
-->
<body>
<my-app></my-app>
<script src="/dist/entry-bundle.js" data-main="main"></script>
</body>
</html>
{
"dependencies": {
"aurelia": "latest"
}
}
<p>This is c1. <strong>Uncomment the commented line in c1.ts</strong></p>
import {containerless} from "aurelia";
//@containerless //THIS LINE MAKES PROBLEM TO COMPOSE
export class C1{
}
export class C2{
}
import Aurelia from 'aurelia';
import { MyApp } from './my-app';
Aurelia.app(MyApp).start();
<import from="./components/c2"></import>
<div>
<template repeat.for="component of components">
<!-- How to make inner component also containerless, without adding @containerless to it? -->
<au-compose containerless view-model.bind="component"></au-compose>
</template>
</div>
<p>Why this below is not containerless?</p>
<c2 containerless></c2>
import {C1} from './components/c1';
import {C2} from './components/c2';
export class MyApp {
public components : [any] = [C1, C2];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment