[dom-if] is not as inert as <template> should be
In 0.5, using a mix of media queries and I was able to create a component that would only load a specific based on said media queries. I've attempted to replicate this element in 1.0, unfortunately without success.
I have a Stack Overflow post here: http://stackoverflow.com/questions/30557315/polymer-1-0-dom-if-does-not-recalculate-when-previously-true
What I'm expecting is to see only one image displayed on the page based on the media query, with only one image requested over the network.
What I'm actually getting: All 4 images are requested at load time, and resizing the window does not get rid of a previously stamped template, which should now be hidden (so, 2 or more images ends up being visible on page, after resizing)
@andrewebdev There is some non-documented (as of yet) feature in the dom-if template. https://github.com/Polymer/polymer/blob/master/src/lib/template/dom-if.html#L57
If you set restamp=true I think you may get the desired result?
<template is="dom-if" if="{{active}}" restamp="true"> <content></content> </template>
Not exactly undocumented. It's described here:
https://www.polymer-project.org/1.0/docs/devguide/templates.html#dom-if
And in the API reference under dom-if:
http://polymer.github.io/polymer/
@arthurevans You are correct. It is documented, which makes sense since it is documented in the code and the docs seem to be autogenerated.
@clintonjrobinson thank you very much; I must've missed that somehow.
That said this still doesn't resolve the main reason I logged this issue. The content enclosed in the template tag is not entirely inert, as it was in 0.5.
You will notice in my example that I have 4 tags. Only one request should be made to the server for the current media query. But it's currently making all 4 requests on load.

This approach to using the template to request only one of the images, worked fine in 0.5.
EDIT: Scrap that, I'm talking bollocks. Just reviewed my old implementation and is not that network friendly as I thought. I mistook it for a different implementation where I actually passed in the different src urls as attributes, not as img tags.