I have a Javascript array of "Album" objects which holds data such as Album Title, Year, Artist, Description
Id like to create a new String Array that holds just the distinct years.
Ive tried a unique pipe from
https://www.npmjs.com/package/ng2-pipes#installation
But have no luck.
My goal is to have a "Filter by year" dropdown which takes a string array of unique years
import {NgPipesModule} from 'ngx-pipes';
<button ngbDropdownItem *ngFor="let album of filteredAlbumListYear | unique " [value]="">{{album.Year}}</button>
Im getting
2019
2019
2019
2019
2018
2018
2017
In the dropdown where i just want
2019
2018
2017