import {Component, ElementRef, Optional} from 'angular2/core'; import {List} from '../list/list'; /** * @name ItemSliding * * @description * Creates a list-item that can easily be swiped, deleted, reordered, edited, and more. * * @usage * ```html * * * * {{item.title}} * * * * * * * * ``` * @see {@link /docs/v2/components#lists List Component Docs} * @see {@link ../../list/List List API Docs} */ @Component({ selector: 'ion-item-sliding', template: '' + '' }) export class ItemSliding { constructor(@Optional() private list: List, elementRef: ElementRef) { list.enableSlidingItems(true); elementRef.nativeElement.$ionSlide = ++slideIds; } /** * @private */ close() { this.list.closeSlidingItems(); } } let slideIds = 0;