@microsoft/fast-element > ElementController > forCustomElement

ElementController.forCustomElement() method

Locates or creates a controller for the specified element.

Signature:

static forCustomElement(element: HTMLElement, override?: boolean): ElementController;

Parameters

Parameter

Type

Description

element

HTMLElement

The element to return the controller for.

override

boolean

(Optional) Reset the controller even if one has been defined.

Returns:

ElementController

Remarks

The specified element must have a FASTElementDefinition registered either through the use of the customElement() decorator or a call to FASTElement.define.