Specifies a noun for the decorated class, property, method, or parameter.
@Noun( noun: undefined | string, plural?: string)Specifies a noun for the decorated class, property, method, or parameter.
undefined | stringstringSpecifies a noun for the decorated class, property, method, or parameter.
Nouns can be used when referencing the object or attribute.
This decorator sets the
nounandnounPluralproperties on the associatedMetadataDescriptor.
@Noun('product', 'products')
class Product {
name: string;
price: number;
}
class Product {
@Noun('SKU')
skuCode: string;
}
class ProductService {
@Noun('product')
getProduct(id: string): void {
// ...
}
}
class ProductService {
create(@Noun('product') product: Product): void {
// ...
}
}
