diff --git a/ionic/components/item/item-sliding.ts b/ionic/components/item/item-sliding.ts index ecdf8cd837..7db35d546a 100644 --- a/ionic/components/item/item-sliding.ts +++ b/ionic/components/item/item-sliding.ts @@ -23,6 +23,8 @@ import {List} from '../list/list'; * * * ``` + * @see {@link /docs/v2/components#lists List Component Docs} + * @see {@link ../../list/List List API Docs} */ @Component({ selector: 'ion-item-sliding', @@ -37,6 +39,9 @@ export class ItemSliding { elementRef.nativeElement.$ionSlide = ++slideIds; } +/** + * @private + */ close() { this.list.closeSlidingItems(); } diff --git a/ionic/components/list/list.ts b/ionic/components/list/list.ts index b57e0d2e41..6c4133cadf 100644 --- a/ionic/components/list/list.ts +++ b/ionic/components/list/list.ts @@ -76,6 +76,22 @@ export class List extends Ion { this.itemTemplate = item; } + /** + * Enable sliding items if your page has them + * + * ```ts + * export class MyClass { + * constructor(app: IonicApp){ + * this.app = app; + * this.list = this.app.getComponent('my-list'); + * } + * stopSliding(){ + * this.list.enableSlidingItems(false); + * } + * } + * ``` + * @param {Boolean} shouldEnable whether the item-sliding should be enabled or not + */ enableSlidingItems(shouldEnable) { if (this._enableSliding !== shouldEnable) { this._enableSliding = shouldEnable; @@ -94,6 +110,23 @@ export class List extends Ion { } } + /** + * Enable sliding items if your page has + * + * ```ts + * export class MyClass { + * constructor(app: IonicApp){ + * this.app = app; + * this.list = this.app.getComponent('my-list'); + * } + * // Here we have some method that will close the items + * // when called + * closeItmes(){ + * this.list.closeSlidingItems(); + * } + * } + * ``` + */ closeSlidingItems() { this.slidingGesture && this.slidingGesture.closeOpened(); }