Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ng-options support in angular 1.4 #58

Open
jamesjwarren opened this issue Dec 16, 2015 · 0 comments
Open

ng-options support in angular 1.4 #58

jamesjwarren opened this issue Dec 16, 2015 · 0 comments

Comments

@jamesjwarren
Copy link

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"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant