i wanna to ask how to render and insert template to specific div. As we know from meteor wiki, this how to do that :
UI.insert(UI.render(Template.something), document.body);
and i place that to rendered or onAfterAction on IronRouter map, and it works. I have a div with id = "content", i wanna place the Template.something to that div, so i try with ordinary query code-like :
UI.insert(UI.render(Template.something), $('#content'));
and i place that to rendered or onAfterAction on IronRouter map, but it doesn't works. please help me how to render and insert to specific div? thanks
As the documentation says, UI.insert() expects a DOM node as its second argument.
UI.insert( UI.render( Template.something ), $( '#content' ).get(0) ));
If that is not working then try both Template.something
and $( '#content' ).get(0)
in then dev console to see what values they have.
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