ngIf inside ngFor not working on iOS


#1

I have a simple *ngFor over an array (challenges) fetched from a firebase database. Within the *ngFor there are 2 *ngIf. This is working fine in Chrome, Firefox and Ionic View/Dev App on Android, but it is not working in Ionic View/DevApp on iOS/iPhone or in Safari browser on OSX (accessing the www folder, copied to a web server).
Here’s the snippet of the html template:

<ion-content>
  <!--*********** List view *********** -->
  <div *ngIf="viewType==='list'">

    <p class="category-header">Aktuell</p>
    <div *ngFor="let challenge of challenges">
      <!-- On iOS/iPhone no ion-card is shown -->
      <ion-card tappable class="card-list" *ngIf="challenge.category === 'aktuell'"  (click)="openActiveChallenge(challenge.$key)">
        <ion-grid>
          <ion-row>
            <ion-col col-2>
              time
            </ion-col>
            <ion-col col-10>
              <h2 class="card-list-title"> {{challenge.dateTimeFrom}}</h2>
              <p class="card-list-description"> {{challenge.location}}</p>
              <p class="card-list-description"> {{challenge.boulderCount}} neue Boulder</p>
            </ion-col>
          </ion-row>
        </ion-grid>
      </ion-card>
    </div>

    <p class="category-header">Upcoming</p>
    <div *ngFor="let challenge of challenges">
      <ion-card tappable class="card-list" *ngIf="challenge.category == 'zukunft'" (click)="openList(challenge.$key)">
        <ion-grid>
          <ion-row>
            <ion-col col-2>
              time
            </ion-col>
            <ion-col col-10>
              <h2 class="card-list-title"> {{challenge.dateTimeFrom}}</h2>
              <p class="card-list-description"> {{challenge.location}}</p>
              <p class="card-list-description"> {{challenge.boulderCount}} neue Boulder</p>
            </ion-col>
          </ion-row>
        </ion-grid>
      </ion-card>
    </div>

  </div>

Thanks for you support!

[Edit:] SOLVED: The reason was, that chrome obviously deals different with Date objects than iOS/Safari.


#2

Hi…@tom5677, can you please post the answer how you have solve this issue. I have the same issue on iOS.
Thanks in advance.


#3

issue has been solved… that was the date format issue…:grinning: