question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

angular 6 ERROR TypeError: items.map is not a function

See original GitHub issue

Hey there, I am using Angular 6 Trying to get the data from the server as this example https://github.com/ng-select/ng-select/blob/master/demo/app/examples/search.component.ts

this is my ng-select :

<ng-select [items]="employees | async" [multiple]="isMultiple" placeholder="Select Employee" [appendTo]="'body'" [(ngModel)]="selectedEmployee" [hideSelected]="true" [loading]="loading" [typeahead]="employeesInput"></ng-select>

I am getting the employees as an observable the same way in the example… but I am getting the error ERROR TypeError: items.map is not a function it is in ng-select.js file, while the items is recieved as a string of my typeahed, but the map is not defined…

and since I am Angular 6 I’ve change the concat as the new RXJS so now it is an operator.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

7reactions
anton-rukhlincommented, Sep 15, 2018

same issue here. can you give a bit more info on how to resolve this? some of us are noobs and that sentences does not draw a complete picture. thank you

6reactions
Ismaestrocommented, Aug 23, 2018

@bdairy can you provide your final solution? we have the same problem …

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular ng-select : selectedItems.map is not a function
When I'm using ng-select in reactive form angular I get this error: ERROR TypeError: ...
Read more >
TypeError: map() is not a function in React | bobbyhadz
The "TypeError: map is not a function" occurs when we call the map() method on a value that is not an array. To...
Read more >
How To Fix object.map is not a function Error in JavaScript
To solve the object.map is not a function error, first figure out the shape of the data you are working with and then...
Read more >
TypeError: "x" is not a function - JavaScript - MDN Web Docs
Maybe there is a typo in the function name? Maybe the object you are calling the method on does not have this function?...
Read more >
state.map is not a function | react error when accessing state
JS - JavaScript. state. map is not a function | react error when accessing state. 14K views 1 year ago. Sagar S. Sagar...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found