-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Typeahead breaks if typeahead property receives NULL value #4417
Comments
I am also facing the same issue. When there is nothing to return from the database for the API call, it is throwing the slice error and then I am unable to search anything anymore. Can someone help in this? |
Can we use the typeaheadNoResults in anyway here? |
Found a workaround. For the empty return value, I am making the API return an empty object, so the slice error is not coming up anymore. This empty object I have renamed as "No record found", so that when it is seen in the UI, it looks as though it is not returning anything. In the TypeaheadOnSelect method, I am clearing the input field :-) Hope this help others who are facing this issue |
…es NULL (valor-software#4957) * fix(typeahead): Typeahead breaks if typeahead property receives NULL * fix(typeahead): restore typehead-directive file * feat(typeahead): add tests for new func * fix(typeahead): rework existing pr Fixes valor-software#4417
…es NULL (valor-software#4957) * fix(typeahead): Typeahead breaks if typeahead property receives NULL * fix(typeahead): restore typehead-directive file * feat(typeahead): add tests for new func * fix(typeahead): rework existing pr Fixes valor-software#4417
The typeahead directive breaks if the [typeahead] property receives a NULL value (with NullPointerException). This happens since my async data service returns NULL instead of [] if no search results were found.
I'm wondering why NULL is not a valid value? In my opinion, the directive should catch undefined values by itself.
ngx-bootstrap: 3.0.0
Angular: 6.0.1
The text was updated successfully, but these errors were encountered: