Page Contents
Home > @loopback/metadata > MetadataInspector > getClassMetadata
MetadataInspector.getClassMetadata() method
Get the metadata associated with the given key for a given class
Signature:
static getClassMetadata<T>(key: MetadataKey<T, ClassDecorator>, target: Function, options?: InspectionOptions): T | undefined;
Parameters
| Parameter | Type | Description |
|---|---|---|
| key | [MetadataKey](/doc/en/lb4/apidocs.metadata.metadatakey.html)<T, ClassDecorator> | Metadata key |
| target | Function | Class that contains the metadata |
| options | [InspectionOptions](/doc/en/lb4/apidocs.metadata.inspectionoptions.html) | _(Optional)_ Options for inspection |
Returns:
T | undefined