I would like to compose components defined with ractivejs library. I know I can do this within one template by having them one next to the other. For instance :
template : "<Component1 /><Component2 />"
But what I want to do, is nesting components, that is something like
template : "<Component1 />"
and in the definition of Component1:
template : "<Component2 />".
My question is : is that possible? With my current code, I get the following error:
Uncaught ParseError: Illegal tag name at line 1 character 224:
<div id='rdt-tt' class='rdt-tt-transover' style='display: {{display}}; top: {{top}}; left: {{left}}; width:{{width}}; height:{{height}}; text-align: {{text_align}}; position:fixed; white-space:nowrap;'> <TT_Content /> </div>
Here is a simplified version of the code:
Tooltip = Ractive.extend({
template: "" +
"<div id='rdt-tt' class='rdt-tt-transover' style='display: {{display}}; top: {{top}}; left: {{left}}; width:{{width}}; height:{{height}}; text-align: {{text_align}}; position:fixed; white-space:nowrap;'> " +
"<TT_Content /> "+
"</div> ",
append: true
});
TT_Content = Component.extend ({
template : "something here",
append: true
});
tooltip = new Ractive({
el: 'output',
append: true,
template: '<Tooltip />',
components: {
Tooltip : Tooltip,
TT_Content : TT_Content
}
});
This is my first question on stackoverflow, I will gladly ask for your forgiveness and advice if I disrespected some of the guidelines.