I'm building a a SPA with polymer that contains multiple pages, each page may consist of a large number of controls. I've was using the core-pages control for this (as recommended:
https://github.com/ebidel/polymer-change/blob/master/demos/spa.html) but I'm aware that the DOM tree may become quite large. So instead I started to write my own polymer tab control that removes the non-visible pages from the DOM and switches the pages in/out when necessary.
My control can be defined something like this:
<tab-control>
<page-one Title="Page One"></page-one>
<page-two Title="Page Two"></page-two>
</tab-control>
To acheive the desired result my element's script removes the pages from the light DOM and inserts only the selected page into the shadow DOM upon selection change of some paper-tabs. However, when I do this the databinding in the child page does not work.
Questions:
1. Can the databinding work in this scenario, is there something I can do to kick it into life again?
2. Is this a valid approach when creating a SPA and trying to reduce the overall DOM size and if not can someone point me to a better pattern?
Many thanks!