Meirion Hughes Meirion Hughes - 1 year ago 64
HTML Question

Aurelia: self-closing require element does not work

Why can't Aurelia deal with self-closing


For example:

<require from="component"></require>

<require from="component"/>
doesn't work

No error is given, yet the entire template will fail if you try to use the self-closing element. Version:


I may be wrong, but here is my opinion.

It is a matter of standard. According to the HTML5 spec, there are just a few void elements (elements that only have a start tag), which are: area, base, br, col, embed, hr, img, input, keygen, link, meta, param, source, track, wbr. More information at

Different from other frameworks, such as Angular2, Aurelia uses the browser's native DOMParser, which means that they must follow the standard. Otherwise, the browser might not be able to understand the syntax.

I believe that <require></require> works internally as kind of web component. So, the "tag" must be "closed".

This is not official, nor 100% right. It is just my opinion.