Specifies a label for the decorated class, property, method, or parameter.
@Label( label: undefined | string, plural?: string)Specifies a label for the decorated class, property, method, or parameter.
undefined | stringstringSpecifies a label for the decorated class, property, method, or parameter.
Labels can be used when displaying in user interfaces such as form inputs, tables, and auto-generated documentation.
This decorator sets the
labelandlabelPluralproperties on the associatedMetadataDescriptor.
@Label('Product', 'Products')
class Product {
name: string;
price: number;
}
class Product {
@Label('SKU')
skuCode: string;
}
class ProductService {
@Label('Create Product')
create(): void {
// ...
}
}
class ProductService {
create(@Label('Product') product: Product): void {
// ...
}
}
