Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Polymer 1: Prevent iron-pages/app-route from attaching all pages at load

I am using Polymer 1 app-route with iron-pages like in the examples and starter-kit. I find that all elements are attached on page load. This causes quite abit of slow down at start. How can I prevent this?

like image 965
Jiew Meng Avatar asked Sep 19 '16 07:09

Jiew Meng


1 Answers

Polymer Staret Kit v2 which is based on the the PRPL pattern supports lazy loading of routes. You can use importHref together with an observer on a route change to lazy load pages for iron-pages. See here for code sample

like image 118
Ümit Avatar answered Sep 22 '22 23:09

Ümit