Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

card which is in card array not display #31

Open
Serizao opened this issue Jun 7, 2017 · 2 comments
Open

card which is in card array not display #31

Serizao opened this issue Jun 7, 2017 · 2 comments

Comments

@Serizao
Copy link

Serizao commented Jun 7, 2017

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>
@mashhoodr
Copy link
Collaborator

@wleberre is it possible for you to recreate this issue using a Plunkr? It would become easier to investigate.

It could be some issue related with change detection within your app, hard to say at this point.

@Serizao
Copy link
Author

Serizao commented Jun 13, 2017

sorry but it is not possible because the problem appear only on android device but when the updateState is call ( ionic menu, ionic alert) the card appear

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants