Skip to content

ng-options support in angular 1.4 #58

Open
@jamesjwarren

Description

@jamesjwarren

When using ng-options with selectpicker in angular 1.4 - changing the model value does not correctly update the selectpicker. I think this may be related to this update of ng-options: https://docs.angularjs.org/guide/migration#ngoptions

Specifically it could be caused by the fact ng-options option values are now prefixed with type like number:1 string:foobar.

<select selectpicker
    ng-model="dobMonth"
    name="dobMonth"
    ng-options="month.id as month.name for month in months">
  <option value>Month</option>
</select>

Using track by seems to work around the issue:
ng-options="month.id as month.name for month in months track by month.id"

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