Skip to content

When single selected value, don't set is as an array with one item #17

@MaZZly

Description

@MaZZly
<sh-select name="tz" [options]="timeZones" [(ngModel)]="project.tz" required
     [placeholder]="'Timezone'"></sh-select> 

I realized that the timezone setting did not validate when sent to my REST endpoint. The reason being that timezone was set as an array with one item. Should be set as the value of selected item.

For now I had to create a workaround in the project.service to send it as a string and not array:

project.tz = (project.tz.length === 1) ? project.tz[0] : project.tz;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions