I am working with JSON data that contains vendor fields and I need to extract unique vendors into an array. Can someone provide guidance on how to achieve this in an Angular2 component?
Here is the sample data:
[{"category": "Living Room", "vendor": "Flexsteel"},
{"category": "Living Room", "vendor": "Klaussner"},
{"category": "Living Room", "vendor": "Flexsteel"},
{"category": "Living Room", "vendor": "Craftmaster"},
{"category": "Living Room", "vendor": "Craftmaster"}]
I would like the resulting array to display only the unique vendors:
[{"vendor": "Flexsteel"},
{"vendor": "Klaussner"},
{"vendor": "Craftmaster"}]