ko-render-html

0.0.1 • Public • Published

ko-render-html

Renders a knockout.js view model into an HTML template.

Currently does not work on IE < 9.

A single global function is exposed:

koRenderHtml(html, model, [map])

  • html should be an HTML template string, optionally with knockout.js bindings.
  • model should be a knockout.js view model, e.g. as generated by ko.mapping.fromJS.
  • map, if present, should be a function receiving a DOM node and returning either a DOM node or null. This function is called for each node in the resulting DOM. If the return value is null, the original node is removed. Otherwise, it is replaced by the return value.

/ko-render-html/

    Package Sidebar

    Install

    npm i ko-render-html

    Weekly Downloads

    3

    Version

    0.0.1

    License

    BSD

    Last publish

    Collaborators

    • tjgq