Skip to content

Releases: Juicy/imported-template

Skip pending request when new content is set

28 Mar 22:37
Compare
Choose a tag to compare

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.

See Juicy/[email protected]

Workaround webcomponentsjs bug again

17 Nov 21:29
Compare
Choose a tag to compare

Clear content, and better Polymer templating support

11 Mar 18:35
Compare
Choose a tag to compare

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

08 Jan 17:22
Compare
Choose a tag to compare
  • Workaround for <imported-template-scope> supporting both Polymer 0.5 and Polymer 1.0 convention was removed

IE, FF and Safari support

08 Jan 17:25
Compare
Choose a tag to compare

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

21 Nov 23:24
Compare
Choose a tag to compare

Polymer dependency removed => Polymer 1.1 supported

17 Sep 16:26
Compare
Choose a tag to compare

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

03 Mar 11:16
Compare
Choose a tag to compare
  • fixed problem with stamping out imported-template in IE11
  • still known issue with template repeat in IE11: #10

Scoping for merged partials

18 Feb 19:31
Compare
Choose a tag to compare

You can now easily match parts of your merged partial with name-spaced JSON model, read more at wiki

Polymer's binding attributes

18 Feb 14:57
Compare
Choose a tag to compare

Added support for regular Polymer's <template> binding attributes: bind, repeat, if