Skip to main content

@microsoft/fast-element > ViewTemplate

ViewTemplate class

A template capable of creating HTMLView instances or rendering directly to DOM.

Signature:
export declare class ViewTemplate<TSource = any, TParent = any> implements ElementViewTemplate, SyntheticViewTemplate 

Constructors

ConstructorModifiersDescription
(constructor)(html, directives)Creates an instance of ViewTemplate.

Properties

PropertyModifiersTypeDescription
directivesReadonlyArray<HTMLDirective>The directives that will be connected to placeholders in the html.
htmlstring | HTMLTemplateElementThe html representing what this template will instantiate, including placeholders for directives.

Methods

MethodModifiersDescription
create(hostBindingTarget)Creates an HTMLView instance based on this template definition.
render(source, host, hostBindingTarget)Creates an HTMLView from this template, binds it to the source, and then appends it to the host.