Hi All,
My company is making a small prototype app with Aurelia2 without using a build tool (no typescript or webpack) just vanilla JS as a proof-of-concept before migrating our other apps over. We love this example and are using it as our goal:
However, our apps will be just slightly too large to fit into one file like this example. Basically I want the app’s structure to be one file per component. Ideally we would split the code into multiple HTML/Template files each with their associated Aurelia Javascript Class. And again I don’t want to rely on TypeScript/Webpack or any other bundler to achieve this.
Pseudocode
/view1.html
<template id="view1">
I am imported/lazy loaded into appRoot
<script type="module">
const view1 = CustomElement.define({
name: 'view1',
template: getTemplate(view'1),
}, class {});
</script>
</template>
/index.html
<template id="appRoot">
I want to lazily import/load view1
<script type="module">
const appRoot = CustomElement.define({
name: 'appRoot',
template: getTemplate('appRoot'),
}, class {});
</script>
</template>
Does anyone have any examples of doing this with or without using the Router? Can <au-slot>
take a URL parameter? Am I over-thinking this? Thanks in advance for your help and advice.