Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

<select> ng-options cannot "track by" a string when "orderBy" filter is used #10225

Closed
SteveShaffer opened this issue Nov 26, 2014 · 1 comment

Comments

@SteveShaffer
Copy link
Contributor

When using a comprehension expression for a element's ngOptions, I cannot use both a "track by" clause and the "orderBy" filter if I'm tracking by a string. But tracking by a number seems to work. Actually, everything seems to bind correctly under the hood, but the element won't show the value in the UI.

Works as expected in version 1.2.1 but doesn't work in 1.3.4.

See this jsFiddle: http://jsfiddle.net/27by0nmt/2/

Might be related to #7544.

@lgalfaso
Copy link
Contributor

The plunker uses the wrong syntax. It should be ng-options="opt.label for opt in options | orderBy:['value'] track by opt.label"

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

No branches or pull requests

2 participants