@microsoft/fast-element > HTMLView
HTMLView class
The standard View implementation, which also implements ElementView and SyntheticView.
Signature:
export declare class HTMLView<TSource = any, TParent = any> extends DefaultExecutionContext<TParent> implements ElementView<TSource, TParent>, SyntheticView<TSource, TParent>, ExecutionContext<TParent>
Extends: DefaultExecutionContext<TParent>
Implements: ElementView<TSource, TParent>, SyntheticView<TSource, TParent>, ExecutionContext<TParent>
Constructors
|
Constructor |
Modifiers |
Description |
|---|---|---|
|
Constructs an instance of HTMLView. |
Properties
|
Property |
Modifiers |
Type |
Description |
|---|---|---|---|
|
ExecutionContext<TParent> |
The execution context the view is running within. | ||
|
Node |
The first DOM node in the range of nodes that make up the view. | ||
|
boolean |
Indicates whether the controller is bound. | ||
|
Promise<boolean> |
Resolves | ||
|
Promise<boolean> |
A promise that resolves with | ||
|
Node |
The last DOM node in the range of nodes that make up the view. | ||
|
TSource | null |
The data that the view is bound to. | ||
|
|
Indicates how the source's lifetime relates to the controller's lifetime. | ||
|
|
Methods
|
Method |
Modifiers |
Description |
|---|---|---|
|
Appends the view's DOM nodes to the referenced node. | ||
|
Binds a view's behaviors to its binding source. On the first call, this iterates through all compiled factories, calling createBehavior() on each to produce a ViewBehavior instance (e.g., an HTMLBindingDirective), and then immediately binds it. This is where event listeners are registered, expression observers are created, and initial DOM values are set. On subsequent calls with a new source, existing behaviors are re-bound to the new data source, which re-evaluates all binding expressions and updates the DOM accordingly. | ||
|
Removes the view and unbinds its behaviors, disposing of DOM nodes afterward. Once a view has been disposed, it cannot be inserted or bound again. | ||
|
|
Efficiently disposes of a contiguous range of synthetic view instances. | |
|
Inserts the view's DOM nodes before the referenced node. | ||
|
Removes the view's DOM nodes. The nodes are not disposed and the view can later be re-inserted. | ||
|
Unbinds a view's behaviors from its binding source. |