Aaron Salazar
Aaron Salazar

Reputation: 4527

Custom labels for DevExtreme Angular2 Form

I am using the latest version of DevExtreme for Angular 2 as I'm writing this which is version 16.2. I have a DevExtreme form which is getting data user from its component. As you can see, there isn't much to it.

<dx-form id="form" [(formData)]="user">
    <dxi-item dataField="fName"></dxi-item>
    <dxi-item dataField="lName"></dxi-item>
</dx-form>

I can't figure out, however, how to change a label from the default which is gathered from the dataField. I've looked around in the documentation and I can't seem to find the answer. I feel like I should be able to write:

<dxi-item dataField="lName" customLabel="Last Name"></dxi-item>

Seems like a feature that should exist and that should be easy to find in documentation.

Upvotes: 2

Views: 2923

Answers (1)

Sergey
Sergey

Reputation: 5476

The label.text option is helpful in your case. The code should be like below:

<dxi-item dataField="lName" [label]="{text: 'Custom Label'}"></dxi-item>

Upvotes: 5

Related Questions