Namespace: KnockoutTemplateUtils

Oracle® JavaScript Extension Toolkit (JET)
5.0.0

E90577-01

QuickNav

PREVIEW: This is a preview API. Preview APIs are production quality, but can be changed on a major version without a deprecation path.

KnockoutTemplateUtils

Version:
  • 5.0.0
Since:
  • 4.0.0
Module:
  • ojknockout
Utility methods for knockout templates.
Since:
  • 4.0.0

Methods

(static) getRenderer(template, bReplaceNode) → {function(Object)}

JET custom elements do not support template binding attributes, so applications using knockout templates should use this utility to convert their knockout templates to a renderer function for use in component renderer APIs instead.
Parameters:
Name Type Argument Description
template string The name of the knockout template to use.
bReplaceNode boolean <optional>
True if the entire target node should be replaced by the output of the template. If false or omitted, the children of the target node will be replaced.
Returns:
A renderer function that takes a context object.
Type
function(Object)
Example

Convert a knockout template to a custom tooltip renderer function:

<oj-tag-cloud tooltip.renderer="[[oj.KnockoutTemplateUtils.getRenderer('tooltip_template')]]"></oj-tag-cloud>