mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 19:21:34 +08:00
refactor(item-groups): updated item groups demo to latest code
This commit is contained in:
@ -4,10 +4,12 @@
|
|||||||
{{data.day}} - Sessions
|
{{data.day}} - Sessions
|
||||||
</ion-item-group-title>
|
</ion-item-group-title>
|
||||||
<ion-item-sliding *ng-for="#session of data.sessions">
|
<ion-item-sliding *ng-for="#session of data.sessions">
|
||||||
|
<button ion-item>
|
||||||
<h3>{{session.name}}</h3>
|
<h3>{{session.name}}</h3>
|
||||||
<p>
|
<p>
|
||||||
<span>{{session.location}}</span>
|
<span>{{session.location}}</span>
|
||||||
</p>
|
</p>
|
||||||
|
</button>
|
||||||
<ion-item-options>
|
<ion-item-options>
|
||||||
<button primary>Speaker Info</button>
|
<button primary>Speaker Info</button>
|
||||||
<button secondary>Add to <br>Favorites</button>
|
<button secondary>Add to <br>Favorites</button>
|
||||||
|
@ -1,21 +1,20 @@
|
|||||||
import {ElementRef, Host} from 'angular2/angular2';
|
import {Component, NgIf, NgFor} from 'angular2/angular2';
|
||||||
import {Component, View, NgIf, NgFor} from 'angular2/angular2';
|
import {App, Icon, Item, ItemGroup, ItemGroupTitle, ItemSliding, List, ListHeader, NavController} from 'ionic/ionic';
|
||||||
import {App, Content, Icon, Item, ItemGroup, ItemGroupTitle, ItemSliding, List, ListHeader, NavController} from 'ionic/ionic';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
properties: ['data'],
|
properties: ['data'],
|
||||||
selector: 'component-list',
|
selector: 'component-list',
|
||||||
directives: [ComponentList, Item, ItemGroup, ItemGroupTitle, ItemSliding, List, NgIf, NgFor],
|
directives: [Item, ItemGroup, ItemGroupTitle, ItemSliding, List, NgIf, NgFor],
|
||||||
templateUrl: 'component-list.html'
|
templateUrl: 'component-list.html'
|
||||||
})
|
})
|
||||||
class ComponentList {
|
export class ComponentList {
|
||||||
constructor(elementRef: ElementRef, @Host() content:Content) {
|
constructor() {
|
||||||
console.log('Component List init', content);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@App({
|
@App({
|
||||||
directives: [Content, ComponentList, Item, ItemGroup, ItemGroupTitle, ItemSliding, List, NgIf, NgFor],
|
directives: [ComponentList],
|
||||||
templateUrl: 'main.html'
|
templateUrl: 'main.html'
|
||||||
})
|
})
|
||||||
class E2EApp {
|
class E2EApp {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
|
<ion-toolbar><ion-title>Item Groups</ion-title></ion-toolbar>
|
||||||
<ion-content class="outer-content content-selected">
|
<ion-content class="outer-content content-selected">
|
||||||
<h4>Component List</h4>
|
|
||||||
<component-list [data]="data"></component-list>
|
<component-list [data]="data"></component-list>
|
||||||
</ion-content>
|
</ion-content>
|
||||||
|
Reference in New Issue
Block a user