Page generated at 2016-08-19 09:38:26 +0000
component.replace() Method
component.replace(DOMElement, classOrInstance, isInstance)
Initialize component on specific DOMElement. (render()
then service()
)
Example
<div class="panel">
<div id="myDiv" class="panel-body"></div>
</div>
<script>
$(function(){
new component('my-component', {
'render': function(){
this.$e.text('Rendered');
}
})
var myComponentInstance = component('my-component').instance();
component.replace($('#myDiv')[0], myComponentInstance, true);
});
</script>