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

Cannot read property 'indexOf' of undefined #677

Closed
alhamdi23 opened this issue Jul 11, 2018 · 3 comments
Closed

Cannot read property 'indexOf' of undefined #677

alhamdi23 opened this issue Jul 11, 2018 · 3 comments
Assignees
Labels

Comments

@alhamdi23
Copy link

alhamdi23 commented Jul 11, 2018

I have issue when have two dropdown list related to each other.
please check exmaple

https://stackblitz.com/edit/ng-select-example-ptfzwl

@varnastadeus
Copy link
Member

Why are you using same property for NgModel and items input? It should be separate properties

@alhamdi23
Copy link
Author

sorry
you are right. now its fixed.
the question is why after selecting primary and secondary and try to change the primary, the value of secondary not change to other list.

the scenario is
1- select primary
2- select secondry
3- try to change the primary
their is error message shown in the console
ERROR
Error: Cannot read property 'indexOf' of undefined

@varnastadeus
Copy link
Member

fixed in #694, but you should use compareWith for it to work correctly

jakemdunn pushed a commit to jakemdunn/ng-select that referenced this issue Oct 16, 2018
NickMele pushed a commit to NickMele/ng-select that referenced this issue Apr 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants