Class: TemplateBinder

TemplateBinder.TemplateBinder()

new TemplateBinder()

Enables the use of HTMLTemplateElement elements as data-templates.

Source:
Example
```html
<html>
 <body>
   <template bind="model.items">
     <h1 bind-textcontent="title"></h1>
     <p bind-textcontent="content"></p>
   </template>
 </body>
</html>
```

```javascript
var model = { items: [
 { title: 'Item 1', content: 'Item 1 content' },
 { title: 'Item 2', content: 'Item 2 content' },
 { title: 'Item 3', content: 'Item 3 content' },
] };
var binder = new Binder(new TemplateBinder());
binder.bind(document.body, model);
```

Members

(static) RECURSE :string

The attribute for defining recursive data-templates.

Type:
  • string
Properties:
Name Type Description
RECURSE
Source: