Caplin Trader 5.1.0

Class: module:br-services/html/BRHtmlResourceService

module:br-services/html/BRHtmlResourceService(url)

Provides access to HTML templates loaded via the HTML bundler. This is the default HtmlResourceService in BladeRunnerJS

Constructor

new module:br-services/html/BRHtmlResourceService(url)

Parameters:
Name Type Description
url String

A URL to load HTML from.

Implements:

Methods

getHTMLTemplate()

Implements:
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.

Implements:
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.

Implements:
Returns:
Type
DocumentFragment