Skip to content

card which is in card array not display #31

@Serizao

Description

@Serizao

Hello

Firstly i want to say thanks for this plugin

I try to build my app with Ionic 2 and for this i use tinder card like this : https://devdactic.com/ionic-2-tinder-cards/ But on some android device ( sony z4 compact, sony z5 compact and HUAWEI P8 lite) next card not load.

The array which contain card is this.cards I try to display it with log and it contain the good value. The card display only after click on button for display menu. Or it can work if used button which call voteUp(true/false) function swipe, in theory call the same function but the result is totaly different. My code :

ts file

addNewCards(count: number) {
  this.auth.getToken().subscribe(data=>{
  let url='http://my.url/api/api.php/'+data+'/repas/' + count;
    let result= this.http.get(url).map(data => data.json().msg)
    this.cache.loadFromObservable('repas'+count, result)
    .subscribe(msgs => {
      for (let val of msgs){
        this.cards.push(val[0]);
      }
    });
  });
}

template file :

<div swing-stack #myswing1 [stackConfig]="stackConfig"   (throwoutleft)="voteUp(false)" (throwoutright)="voteUp(true)" id="card-stack">
    <ion-card class="card" #mycards1 swing-card *ngFor="let c of cards">
      <div *ngIf="c.photo" class=" image-recipe-position">
        <div class="img-recipe"   [ngStyle]="{ 'background-image': 'url(' + c.photo + ')'}">
        </div>
      </div>
      <ion-item >
        <h2>{{c.title}}</h2>
        {{c.ing}}
      </ion-item>
        <ion-row  >
          <ion-col col-4 offset-1 class="center-left">
            <button disabled={{buttonDisabled}}   (click)="voteUp(false)" class="button-choose">
              <ion-icon class="dislike" name="ios-close"></ion-icon>
            </button>
          </ion-col>
          <ion-col class="center-right" col-4 offset-2>

            <button disabled={{buttonDisabled}}   (click)="voteUp(true)" class="button-choose">
              <ion-icon class="like" name="ios-checkmark"></ion-icon>

            </button>
          </ion-col>
        </ion-row>
    </ion-card>

  </div>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions