i have this JSON response
places":[{"libPlace":"Le Colis\u00e9e","idPlace":1},[{"dateEventPlace":"2017-03-19T08:09:00+0000"},{"dateEventPlace":"2017-03-19T14:19:00+0000"},{"dateEventPlace":"2017-03-24T14:08:00+0000"}],{"libPlace":"ABC","idPlace":2},[{"dateEventPlace":"2017-03-22T14:10:00+0000"},{"dateEventPlace":"2017-03-24T16:20:00+0000"}]]
i want to get something like that (i'm using Angular2)
libPlace : 2017-03-19T08:09:00+0000
2017-03-19T08:09:00+0000
2017-03-19T08:09:00+0000
i've tried this and it returns just the "libPlace" values
<div *ngFor="let place of places " class="day clearfix">
{{place.libPlace}}
<div *ngFor="let times of place ">
{{times?.dateEventPlace}}
</div>
</div>
here is my component.ts
places: any[];
ngOnInit(){
this.route.params
this.route.params
.switchMap((params: Params) =>{
return this.movieService.getPlaces(+params['id']);
})
.subscribe((places: any) => {this.places = places;
});
i also tried to send this to angular2 and ignore duplicates using a pipe or the _groupBy (from _Underscore.js) but still it didn't work with me
"places":[{"libPlace":"Le Colis\u00e9e","idPlace":1,"dateEventPlace":"2017-03-19T08:09:00+0000"},{"libPlace":"Le Colis\u00e9e","idPlace":1,"dateEventPlace":"2017-03-19T14:19:00+0000"},{"libPlace":"Le Colis\u00e9e","idPlace":1,"dateEventPlace":"2017-03-24T14:08:00+0000"},{"libPlace":"ABC","idPlace":2,"dateEventPlace":"2017-03-15T07:13:00+0000"},{"libPlace":"ABC","idPlace":2,"dateEventPlace":"2017-03-22T14:10:00+0000"},{"libPlace":"ABC","idPlace":2,"dateEventPlace":"2017-03-24T16:20:00+0000"}]}