Skip to content

Displaying labels for radio boxes instead of values #47

Closed
@DerekDomino

Description

@DerekDomino

I would like to implement the display of labels instead of values in radio boxes and would like to discuss about the best way to declare such labels in the forms-angular/mongoose model.

Currently a group of radio boxes can created with the following declaration:

myRadio: {
    type: String,
    enum: ['choice1', 'choice2'],
    form: {
        type: 'radio'
    }
}

According to mongoose documentation and source code, the enum property can be an object with a required 'values' entry. It seems we can add custom properties to this object.

Proposition:

myRadio: {
    type: String,
    enum: {
        values: ['choice1', 'choice2'],
        labels: ['Pizza', 'Lamb stew']
    }
    form: {
        type: 'radio'
    }
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions