template-instance

TemplateInstance polyfill

Usage no npm install needed!

<script type="module">
  import templateInstance from 'https://cdn.skypack.dev/template-instance';
</script>

README

TemplateInstance

Template Instantiation polyfill

Installation

$ npm install template-instance

Usage

index.html.

<template id=template>
    Hello, {{ name || 'user' }}
</template>

<script type=module>
    import 'node_modules/@custom/template-instance/dist/'

    const instance = template.createInstance({ name: 'Robins' })
    document.body.append(instance) 

    instance.update({ name: 'Bobins' }) 
</script>