This repository was archived by the owner on Apr 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27.4k
ngOptions group by does not display groups with value 0 #7015
Milestone
Comments
It looks like a real bug, but the fix will involve a small breaking change |
As a size note using the string |
lgalfaso
added a commit
to lgalfaso/angular.js
that referenced
this issue
Apr 7, 2014
Accept `0` and an option group Close angular#7015 BREAKING CHANGE When using option groups at an ng-option, the literal `0` will be handled as a group with label `'0'`. Use the literal string `''` or undefined for options that should not be in any option group
Yeah, using 'toString()' should be a viable workaround most of the time. However my guess is this is using truthy evaluation, so I would suspect this would also break on blank strings, which are probably also a valid use case? |
lgalfaso
added a commit
to lgalfaso/angular.js
that referenced
this issue
Apr 7, 2014
Accept `0` and an option group Close angular#7015 BREAKING CHANGE When using option groups at an ng-option, the literal `0` will be handled as a group with label `'0'`. Use the literal string `''` or undefined for options that should not be in any option group
@rmehlinger I think that using |
petebacondarwin
added a commit
to petebacondarwin/angular.js
that referenced
this issue
Sep 18, 2015
Now one can use `''`, `0`, `false` and `null` as option groups. Previously all of these falsy values were treated as the option not being a member of a group. Closes angular#7015 Closes angular#7024 BREAKING CHANGES If your data contains falsy values for option groups, then these options will now be placed into option groups. Only option groups that are `undefined` will result in the option being put in no group. If you have data that contains falsy values that should not be used as groups then you must filter the values before passing them to `ngOptions` converting falsy values to `undefined`.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
When using the "group by" feature in ngOptions, if one of your groups has a value of 0, that group will not display in the dropdown. Rather its elements will appear not to be part of a group.
Plunker: http://plnkr.co/edit/ykKLmAHRj6mEO6XIeBRH?p=info
The text was updated successfully, but these errors were encountered: