Template

Monster/DOM. Template

you can call the method via the monster namespace new Monster.DOM.Template().

<script type="module">
import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.6.0/dist/modules/dom/template.js';
console.log(new Monster.DOM.Template())
</script>

Alternatively, you can also integrate this function individually.

<script type="module">
import {Template} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.6.0/dist/modules/dom/template.js';
console.log(new Template())
</script>

Constructor

new Template(template)

Source:
Since:
  • 1.6.0
Parameters:
Name Type Description
template HTMLTemplateElement
Throws:
  • value is not an instance of

    Type
    TypeError
  • value is not a function

    Type
    TypeError
  • the function is not defined

    Type
    Error

Methods

createDocumentFragment() → {DocumentFragment}

Source:
Throws:

value is not an instance of

Type
TypeError
Returns:
Type
DocumentFragment

getTemplateElement() → {HTMLTemplateElement}

Source:
Returns:
Type
HTMLTemplateElement