Caplin Trader 5.1.0

Interface: module:br-services/HtmlResourceService

module:br-services/HtmlResourceService

A service that provides access to HTML templates.

Methods

getHTMLTemplate()

Deprecated:
  • as this method has now been renamed to #getTemplateElement.

getTemplateElement(templateId) → {HTMLElement}

Retrieve a given template as an element — only singly rooted templates can be retrieved this way.

Parameters:
Name Type Description
templateId String

The identifier of the template you wish to retrieve.

Throws:

RangeError if the template contains more than one root node.

Returns:
Type
HTMLElement

getTemplateFragment(templateId) → {DocumentFragment}

Retrieve a given template as a document-fragment.

Parameters:
Name Type Description
templateId String

The identifier of the template you wish to retrieve.

Returns:
Type
DocumentFragment