I'm having a hard time trying to figure out how to iterate through json data to gather all the duplicate Id's to display the "dateTimes" that match their Id.
for example, I need it to display similar to this: Regal Broward Stadium 12 & RPX 2017-09-20 13:30 2017-09-20 16:00 2017-09-20 18:35
Flipper's Hollywood Cinema 10 2017-09-20 12:40 2017-09-20 14:40 2017-09-20 16:35
I wrote a function that I think that would work for just one Id but I don't know how I would find all the matching Id's to display the dateTimes.
getShowtimes(data){
var json = JSON.parse(data);
for(let i = 0; json.theater.id; i++){
if (json[i].theatre.id == 10863){
json[i].theatre.dateTime;
}
}
}
right now i'm not using the function to display the results(cause it doesn't work ), I'm just using the code below.
<div class="showtime" *ngFor="let shows of show">
<div *ngFor="let detail of shows.showtimes>
<div *ngIf="detail.theatre.id == 10863">
{{detail.theatre.name}}{{detail.dateTime}}
</div>
</div>
</div>