Usage
Typescript Import Format
//This namespace exports multiple static methods or members. To import
import * as KnockoutTemplateUtils from "ojs/ojknockouttemplateutils";
//Now you can access the methods as KnockoutTemplateUtils.methodName and so on
For additional information visit:
Utility methods for knockout templates.
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)