meteor - Spacebars retrieving template from javascript -
i've migrated meteor 0.8, i'm having headache migrating handlebars spacebars.
currently in javascript function, retrieve template , put inside leaflet popup.
var marker = new l.marker(...) .addto(map).bindpopup(template.popupform({ data: data }));
what equivalent in spacebars ?
thank you
template.name
no longer returns html content, returns template object needs rendered , inserted via meteor's methods. since need pass ready dom element leaflet's method, need create intermediate div. first you'll render template div, can pass leaflet's bindpopup
method.
code:
var div = document.createelement('div'); ui.insert(ui.renderwithdata(template.popupform, { data: data, }), div); l.marker(...).addto(map).bindpopup(div);
Comments
Post a Comment