Renderer for data-table rows using very simple templates
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
test
.gitignore
README.md
component.json
index.js

README.md

template-render

Renderer for data-table rows using very simple templates

Usage

Initialize

var renderer = require('template-render');

Set Template

There are two ways of setting the template to render. You can either do so in the html or the JavaScript.

From HTML:

<html>
  <thead>
    <tr><th>Username</th><th>Real Name</th></tr>
  </thead>
  <tbody>
    <script type="application/row-template">
      <tr><td>{{username}}</td><td>{{realName}}</td></tr>
    </script>
  </tbody>
</html>

From JavaScript:

renderer = renderer('<tr><td>{{username}}</td><td>{{realName}}</td></tr>');

Register

To register this as the renderer for a given data-table:

table.renderer(renderer);