Skip to main content

@microsoft/fast-element > AttachedBehaviorHTMLDirective > createBehavior

AttachedBehaviorHTMLDirective.createBehavior() method

Creates a behavior for the provided target node.

Signature:
createBehavior(target: Node): Behavior;

Parameters

ParameterTypeDescription
targetNodeThe node instance to create the behavior for.
Returns:

Behavior

Remarks

Creates an instance of the behavior type this directive was constructed with and passes the target and options to that behavior's constructor.