Skip to content

Determine a way to prevent objects in template code from getting executed #55

@cvan

Description

@cvan

Need to figure out a way to do this:

<template>
  <p>Hi, my name is ${name}.</p>
</template>

```js
var t = document.querySelector('template');
var newHTML = t.innerHTML.replace('${name}', 'seavan');  // This is equivalent to where we do string replacements for variables.

var d = document.createElement('div');
d.innerHTML = newHTML;
document.body.appendChild(d);

Code in <template> elements is not supposed to get executed (i.e., is not live). But because the <template> code has to be parsed to do string replacement.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions