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

ng-options duplicates all <option> entries if manual <option> included with ng-if directive on it. #13065

Closed
pavlovich opened this issue Oct 9, 2015 · 5 comments

Comments

@pavlovich
Copy link

If I create a and use ng-options to populate the available options, and if I want to include a default option using a child element but I want that inclusion to be conditional specified with a ng-if directive, then ng-options will duplicate all of the options. If I use ng-show instead of ng-if, all works as I would expect. See the following plunker: http://plnkr.co/edit/eXkvYQvsyPKEjPKEndhZ?p=preview

@pkozlowski-opensource
Copy link
Member

It looks like it is fixed in master: http://plnkr.co/edit/eXkvYQvsyPKEjPKEndhZ?p=preview

@pavlovich
Copy link
Author

I clicked on the link you provided (the plunker) but found that it was
still broken in that plunker. Can you point me to an updated plunker that
shows this working on master?

On Fri, Oct 9, 2015 at 1:05 PM, Pawel Kozlowski notifications@github.com
wrote:

It looks like it is fixed in master:
http://plnkr.co/edit/eXkvYQvsyPKEjPKEndhZ?p=preview


Reply to this email directly or view it on GitHub
#13065 (comment)
.

@pkozlowski-opensource
Copy link
Member

@pavlovich sorry, copied the wrong link. Here you go: http://plnkr.co/edit/GmCbsH0xrMPxviMFD2Qv?p=preview

You can always reference build from master using https://code.angularjs.org/snapshot/

@pavlovich
Copy link
Author

Actually, the plunker at the link you provided does not work! It does not
add the 'extra' / 'default' choice to the list at all now. If I remove the
ng-if or change it to an ng-show, it works. As it is in the plunker, it is
non-functional (the extra item does not show up regardless of the value of
the ng-if).

Best regards,

Peter

On Fri, Oct 9, 2015 at 3:11 PM, Pawel Kozlowski notifications@github.com
wrote:

@pavlovich https://github.com/pavlovich sorry, copied the wrong link.
Here you go: http://plnkr.co/edit/GmCbsH0xrMPxviMFD2Qv?p=preview

You can always reference build from master using
https://code.angularjs.org/snapshot/


Reply to this email directly or view it on GitHub
#13065 (comment)
.

@gkalpak
Copy link
Member

gkalpak commented Oct 12, 2015

Closing as duplicate of #12190.
Track #13029 for a solution.

@gkalpak gkalpak closed this as completed Oct 12, 2015
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

3 participants