I have a ion-sliding-list component that has three options that slide from the left and three that slide from the right. Each with it’s own click function
Each function changes the status of the list-item either text or color, but doesn’t move to another page.
It would seem that the function closeSlidingItems() would be ideally suited to what I want - i.e. click the slide-options button then slide everything back.
I did get teh “Ionic Serve” to work with a “.close” by passing this <ion-item-sliding #slidingItem> into the click function <button (click)=“startTravel(slidingItem)” … and the function looking like this:
startTravel(slidingItem: List) {
this.dataService.addActivity(“StartTravel”, this.appt.booking.jobid);
this.timeStatus = “Travel to…”;
slidingItem.close();
// worked with ionic serve, but when attempting to ionic cordova build android everything went haywire
…
So - back to my question… closeSlidingtems() is in the documentation, and I found it in the ionic-angular components as a function…
Why isn’t it working? or has it never worked? And looking at the meager search results and trying a few options I’m getting nowhere.
Thanks for that - I persevered with that code (I had tried it earlier but had a lot of trouble…) - so now I have it working for “ionic serve” and now the cordova build is working!!!
import { Component, ViewChild} from ‘@angular/core’;
import { IonicPage, NavController, NavParams, AlertController, List } from ‘ionic-angular’;
import { MydataProvider } from ‘…/…/providers/mydata/mydata’;
import { JobSafetyPrestartPage } from ‘…/job-safety-prestart/job-safety-prestart’;
ionViewDidLoad() {
console.log('ionViewDidLoad JobViewPage ’ );
}
// I call this function from my other functions - ALL GOOD!!!
closeSliding() {
this.list.closeSlidingItems();
}