riot-js

Open full view…

Will mounting parent tag auto mount nested tags?

Jamie Hunter Warnock
Sun, 15 Feb 2015 17:34:16 GMT

For example in my index.html where tags <page> and <todo> are separate tag files: --- <page id='tasks'> <todo></todo> </page> --- I was hoping to have a reuseable <page> tag as a container and when mounted will auto mount its child custom tags! --- riot.mount('page#tasks'); --- Will not auto mount any nested custom tags, i think i need to create a <tasks> tag and nest <todo> inside - right? - so modular UI construction! --- <tasks> <todo></todo> </tasks> riot.mount('tasks'); --- regards, Jamie

Tero Piirainen
Tue, 17 Feb 2015 08:25:39 GMT

[Nested tags](/riotjs/guide/#nested-tags) are not the same as [Nested HTML](/riotjs/guide/#nested-html) so yeah... the nested tags should always be declared on the parent tag definition.