Skip to main content

descriptionProperty

descriptionProperty(propertyName): (constructor) => void

Sets ResourceDescription.resourceDescriptionProperty in ResourceMeta.description.

This decorator updates resource metadata (InternalResourceMeta.description), indicating that a particular model property is "descriptive" for the resource. For example, this could be the name, title, or label property, which is used to display a short description of the resource in the user interface.

By default, when a resource (for example, Teacher) is displayed, the user sees its name as the main descriptive field. After applying this decorator, you can change which property is shown, for example, to lastName.

Properties name and description are automatically treated as descriptive by default. Use this decorator if you want to explicitly specify another property for the resource description.

Before applying the decorator:

StudentTeacher
AliceJohn
BobMary
CharlieEmma
DanaFrank

After applying descriptionProperty to the Teacher resource with propertyName: 'lastName':

StudentTeacher
AliceSmith
BobJohnson
CharlieWilliams
DanaBrown

Parameters

propertyName

string

The name of the property to be used as the description.

Returns

(constructor): void

Parameters

[constructor](function Object() { [native code] })

Constructor<unknown>

Returns

void