@microsoft/fast-element > Controller
Controller class
Controls the lifecycle and rendering of a FASTElement
.
export declare class Controller extends PropertyChangeNotifier
Remarks
The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the Controller
class.
Properties
Property | Modifiers | Type | Description |
---|---|---|---|
definition | FASTElementDefinition | The element definition that instructs this controller in how to handle rendering and other platform integrations. | |
element | HTMLElement | The element being controlled by this controller. | |
isConnected | boolean | Indicates whether or not the custom element has been connected to the document. | |
styles | ElementStyles | null | Gets/sets the primary styles used for the component. | |
template | ElementViewTemplate | null | Gets/sets the template used to render the component. | |
view | ElementView | null | The view associated with the custom element. |
Methods
Method | Modifiers | Description |
---|---|---|
addBehaviors(behaviors) | Adds behaviors to this element. | |
addStyles(styles) | Adds styles to this element. Providing an HTMLStyleElement will attach the element instance to the shadowRoot. | |
emit(type, detail, options) | Emits a custom HTML event. | |
forCustomElement(element) | static | Locates or creates a controller for the specified element. |
onAttributeChangedCallback(name, oldValue, newValue) | Runs the attribute changed callback for the associated element. | |
onConnectedCallback() | Runs connected lifecycle behavior on the associated element. | |
onDisconnectedCallback() | Runs disconnected lifecycle behavior on the associated element. | |
removeBehaviors(behaviors, force) | Removes behaviors from this element. | |
removeStyles(styles) | Removes styles from this element. Providing an HTMLStyleElement will detach the element instance from the shadowRoot. |