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

Ionic 4 ion-item-sliding cannot closed by api

$
0
0

@garyc2232 wrote:

Hi, I am using ion-item-sliding and i want it to be close after i click the button. However i try to use IonItemSliding.close() to close the ion-item-sliding, but it said
ERROR Error: Uncaught (in promise): TypeError: item.close is not a function TypeError: item.close is not a function

Below is my code

//test.html
<ion-item-sliding *ngFor="let item of items">
    <ion-item-options #item side="end">
            <ion-item-option (click)="unread(item.status, item)">click me</ion-item-option>
    </ion-item-options>
</ion-item-sliding>
//test.ts
import { IonItemSliding } from '@ionic/angular';
...
unread(s, item: IonItemSliding){
    console.log(s);
    item.close();

  }

This is my reference from ionic 3

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70440

Trending Articles



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