All the examples for aurelia seem to place the aurelia-app
directive on the <body>
element.
Can aurelia-app
be placed on other html elements, rather than on <body>
? If so, would there be a reason to avoid doing so?
The official documentation states:
Simply place this on an HTML element and Aurelia's bootstrapper will load an app.js and app.html, databind them together and inject them into the DOM element on which you placed that attribute.
I tested this with:
<body>
<div aurelia-app="app-window">
</div>
...
</body>
and it does indeed appear to inject your aurelia app at that point:
What I don't know is if this is a good idea or not, i.e. if there going to be unforeseen problems by doing this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With