0

I am new to angular JS 2.x. Now I am filling my combobox from json file. For eg, I am getting "id" alone from json file and fill my combobox. But id can be repeated with multiple times. I want to remove those duplication and show unique ids alone.

Pls help me. My code

<select>
    <option>All</option>
     <option *ngFor="let data of datas ">
    {{data.deviceId}}
    </option>
</select>
Selvaraj
  • 9
  • 9
  • If you can't remove the duplicates from the array directly (ie. you need them for some other purpose), have you considered using a pipe? – Micheal Hill Dec 29 '16 at 06:37
  • Nope. Since i am new to angular js. I dont know abt that. Pls provide some example or link. so that i can implement – Selvaraj Dec 29 '16 at 10:45
  • Hopefully this helps! Let me know if you need more help: https://angular.io/docs/ts/latest/guide/pipes.html – Micheal Hill Dec 30 '16 at 01:17

0 Answers0