Rendering Components

The quick start tutorial explains how to create and render a new component. In its examples components are always being appened directly to the document's body though, but what's usually necessary is to render in a specific position.

Replacing an existing element

If you wish your component to replace an existing element on the dom, you just need to pass it (or a selector for it) as the element property of the constructor configuration, like this:

Specifying the parent

You can also specify the parent element that should receive the component's contents via the second constructor param, like this: