Skip to content
Advertisement

How to avoid duplicate items in a drop down list to display?

I would like to create a drop-down list and retrieve the elements from a webService.

My problem is that I would like to avoid displaying duplicate items because I have 9999 items.

Here is the JSON file.

enter image description here

Do you think it is possible to do this? Because, I have no idea how to program this?

The display method is this:

JavaScript

corporate.component.ts

JavaScript

corporate.response.ts

JavaScript

corporate.ts

JavaScript

corporate.component.html

JavaScript

Thanks

Advertisement

Answer

I think you could use the distinct operator like this:

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement