Releases: Juicy/imported-template
Skip pending request when new content is set
Starting from now, once new content is set pending request/import (if any) will be skipped - no action will be taken once response comes/file is loaded.
Workaround webcomponentsjs bug again
- Protect itself against the side-effects of webcomponents/webcomponentsjs#470 workaround
Clear content, and better Polymer templating support
Now, stamped nodes will get cleared after content attribute is removed/set to null.
As in Juicy/[email protected]
Also imported-template
will forward Polymer's notification to communicate enclosing dom-bind
with imported ones.
Other fixes:
- Support empty models for scoped templates
- minor cross browsers support issues
1.2.0
IE, FF and Safari support
Now, we support all major browsers.
There was an issue on polyfilled browsers with execution of scripts within imported template.
Workarounds for shim issues and glitches were introduced, so scripts are now run cross-browser, and even get correct position in DOM, e.g. document._currentScript.previousElement
points to correct node.
1.0.3
Polymer dependency removed => Polymer 1.1 supported
Thanks to dependency removal we are not only support pure HTML/JavaScript usage, but it makes us fully compatible with Polymer 1.1 🎉
As for
imported-template
still lets you include HTML given in attribute or from external file.
But now it provides extremely simple - but native - binding feature, which attaches given object to all root nodes of loaded content. Such feature plays nice with Polymer's auto-binding templates, the only difference is that if you want to use it, you need to do it explicitly. (Yey! even more declarative).
If previously your code looked like:
<template bind id="tpl">
<template is="imported-template" content="./template/to/import.html" bind="{{data}}"></template>
</template>
<script>
document.getElementById("tpl").model = {
data: {
name: "World"
}
};
</script>
./template/to/import.html:
<!-- some html imports, scripts, whatever, then: -->
<template>
<h1>Hello <strong>{{name}}</strong></h1>
</template>
Now, it should look like
<template is="imported-template"
content="./template/to/import.html"
model="{
name: "World"
}">
</template>
./template/to/import.html:
<!-- some html imports, scripts, whatever, then: -->
<link rel="import" href="/path/to/polymer.html">
<template>
<template is="dom-bind">
<h1>Hello <strong>{{model.name}}</strong></h1>
</template>
</template>
Naturally, you can also wrap <template is="imported-template">
within dom-bind
and provide content
, and model
attributes using binding. (check our demos, for more examples)
0.0.9: Fix for IE11
- fixed problem with stamping out
imported-template
in IE11 - still known issue with
template repeat
in IE11: #10
Scoping for merged partials
You can now easily match parts of your merged partial with name-spaced JSON model, read more at wiki
Polymer's binding attributes
Added support for regular Polymer's <template>
binding attributes: bind
, repeat
, if