googlearchive / TemplateBinding

TemplateBinding Prolyfill
290 stars 61 forks source link

Running on elements not included in the DOM #204

Open David-Mulder opened 9 years ago

David-Mulder commented 9 years ago

So, first of all, I am probably doing something wrong, if not I must have encounted a bug. To be honest I have no idea which one it is, I would expect the following to work:

 a = document.createElement("template");
 a.innerHTML = "{{a}}";
 a.model = { a: 'Sam' };
 Platform.performMicrotaskCheckpoint();
 a.innerHTML; //just to return it if you run from console

Sadly though none of my attempts have succeeded. (And if you wonder why I need it, I just need some extra control over something to prevent wasting a lot of resources on out of screen elements).