javascript - How to remove a rendered template in MeteorJS? -
i have added template rendering dynamically:
var mytemplate = meteor.render(meteor.template.foo); document.body.appendchild(mytemplate); now want remove template dom, template have list of elements.
the meteor render, use documentfragment, can't reuse mytemplate variable because doesn't have content anymore.
what correct way remove template element contents dom using meteorjs?
under current rendering engine, believe clean injected template satisfactorily if you've given top level element in id mytemplate:
var thisnode = $('#mytemplate')[0]; spark.finalize(thisnode); $(thisnode).remove(); as know, spark go away forever though, time being. suspect .removeing element enough in blaze, can't evidence haven't made switch yet...
Comments
Post a Comment