ngFor Help


#1

Hi, I want you to help me with this code

<ion-row id=“rowhours” *ngFor=“let i of days”>

<h5 style=“color:#ffffff” *ngIf="(i.cinema_name)">{{ i.cinema_name }}

Sala {{ i.room }}


<ion-col class=“sizegrid” col-6 *ngFor=“let j of i.date”>

{{ j.split(’,’)[0] }}


{{ j.split(’,’)[1] !== undefined ? j.split(’,’)[1] + ‘pm’ : ‘’ }}
{{ j.split(’,’)[2] !== undefined ? ‘, ’ + j.split(’,’)[2] + ‘pm’ : ‘’ }}
{{ j.split(’,’)[3] !== undefined ? ‘, ’ + j.split(’,’)[3] + ‘pm’ : ‘’ }}
{{ j.split(’,’)[4] !== undefined ? ‘, ’ + j.split(’,’)[4] + ‘pm’ : ‘’ }}



I want the h5 to disappear when the i.cinema_name is repeated


#2

this is work for me
angular 2 unique filter


#3

Move all this splitting logic into the controller and out of the template. Template expressions are evaluated on every change detection loop, so you want to do everything you can to make them as simple as property accesses.