blockly > ComponentManager > hasCapability
ComponentManager.hasCapability() method
Returns whether the component with this id has the specified capability.
Signature:
hasCapability<T>(id: string, capability: string | Capability<T>): boolean;
Parameters
Parameter | Type | Description |
---|---|---|
id | string | The ID of the component to check. |
capability | string | Capability<T> | The capability to check for. |
Returns:
boolean
Whether the component has the capability.