mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 19:57:22 +08:00
34 lines
819 B
TypeScript
34 lines
819 B
TypeScript
import {Component, ElementRef, Renderer} from 'angular2/angular2';
|
|
|
|
|
|
/**
|
|
* Creates a list-item that can easily be swiped,
|
|
* deleted, reordered, edited, and more.
|
|
*
|
|
* @usage
|
|
* ```html
|
|
* <ion-list>
|
|
* <ion-item *ng-for="#item of items" (click)="itemTapped($event, item)">
|
|
* {{item.title}}
|
|
* <ion-note item-right>
|
|
* {{item.note}}
|
|
* </ion-note>
|
|
* </ion-item>
|
|
* </ion-list>
|
|
* ```
|
|
*/
|
|
@Component({
|
|
selector: 'ion-item,[ion-item]',
|
|
template:
|
|
'<ng-content select="[item-left]"></ng-content>' +
|
|
'<ng-content select="[item-right]"></ng-content>' +
|
|
'<ion-item-content>' +
|
|
'<ng-content></ng-content>'+
|
|
'</ion-item-content>'
|
|
})
|
|
export class Item {
|
|
constructor(elementRef: ElementRef, renderer: Renderer) {
|
|
renderer.setElementClass(elementRef, 'item', true);
|
|
}
|
|
}
|