Skip to content

Instantly share code, notes, and snippets.

@marioblas
Last active August 29, 2015 13:58
Show Gist options
  • Save marioblas/9956356 to your computer and use it in GitHub Desktop.
Save marioblas/9956356 to your computer and use it in GitHub Desktop.
Meteor 0.8.0 (blaze) - Inserting some reactive Meteor UI content into an existing document
/**
* Inserting some reactive Meteor UI content into an existing document.
*
* UI.render instantiates a template and UI.insert adds it as a child of some element in the DOM.
* UI.renderWithData is like UI.render which also sets the data context.
*/
UI.insert(UI.render(Template.foo), document.body);
UI.insert(UI.renderWithData(Template.foo, {bar: "baz"}), document.body);
UI.insert(UI.render(Template.bar), parentNode, beforeNode);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment