Template state variables are Model Object types and contain a template. The state variable value is a template: A Template object, a string, a number, a DOM node, or an array containing a mix of these types. Template state variables are considered changed after each assignment regardless of value. When rendered, they will display the content template.
Template state variables allow another form of dynamic display. The <When> component provides a similar dynamic display, though it is more useful when the output template depends on a few state variables. Template state variables are more appropriate for more complex computations or server-generated content.
'template', class: TemplateSvctl.createPage({
...,
stateVarInfo:[
{type:'template', ...},
],
})
infoinfo object can contain the following properties, but subclasses of StateVar may have additional properties:
Note: The component() method returns a TemplateSvCmp.
template Component will render an <span> that contains the contents.<span> content will be synchronized with the state variable value.<span> element will have a className that contains svIo_templateOutput