My application utilizes the same service data on both a Parent and Child page.
While attempting to filter the data for unique values based on a specific column using ngx-filter-pipe module, I am encountering an issue where all values are still being returned.
How can I ensure that only distinct values are returned?
Here is my code:
.module.ts-
import { NgModule } from '@angular/core';
import { NgPipesModule } from 'ngx-pipes';
@NgModule({
imports: [
NgPipesModule
]
})
...
.component.html-
<div padding=true>
<ul>
<li *ngFor="let group of musicList| unique: PLAYLIST_GROUP"></li>
</ul>
</div>
Data retrieved from the service:
[
{
"KEYS": 1,
"ARTIST": "Jamila Woods",
"TITLE": "LSD",
"ALBUM": "HEAVN",
"PLAYLIST_GROUP": "RnB/Soul",
"COUNT": 3
},
{
"KEYS": 2,
"ARTIST": "Travis Scott",
"TITLE": "SICKO MODE",
"ALBUM": "ASTROWORLD",
"PLAYLIST_GROUP": "Hip Hop",
"COUNT": 1
},
{
"KEYS": 3,
"ARTIST": "Rihanna",
"TITLE": "ANTI",
"ALBUM": "Yeah, I Said it",
"PLAYLIST_GROUP": "RnB/Soul",
"COUNT": 3
},
{
"KEYS": 4,
"ARTIST": "Summer Walker",
"TITLE": "Girls Need Love",
"ALBUM": "Last Day of Summer",
"PLAYLIST_GROUP": "RnB/Soul",
"COUNT": 3
}
]