Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 71531

Angular2-swing with ionic not work on some smartphone

$
0
0

@serizao wrote:

Hello
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>

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 71531

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>