How to use closeSlidingItems()

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.timeStatus = “Travel to…”;
// 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.


You follow almost exactly the sample code in the List API.

Is this something you created yourself?

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’;

selector: ‘page-job-view’,
templateUrl: ‘job-view.html’,
export class JobViewPage {
@ViewChild(List) list: List;

appt: any;
timeStatus : string;
timeStatusTime : any;

constructor(public navCtrl: NavController, public navParams: NavParams,public dataService: MydataProvider,
private alertCtrl: AlertController) {
this.appt = this.navParams.get(‘appt’);
console.log(’ job-view.ts constructor '+JSON.stringify(this.appt));
this.timeStatus = " ";

ionViewDidLoad() {
console.log('ionViewDidLoad JobViewPage ’ );
// I call this function from my other functions - ALL GOOD!!!
closeSliding() {