mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 20:33:32 +08:00
@ -1,4 +1,4 @@
|
|||||||
import { Directive, ElementRef, EventEmitter, Host, Input, NgZone, Output } from '@angular/core';
|
import { Directive, ElementRef, EventEmitter, Input, NgZone, Output } from '@angular/core';
|
||||||
|
|
||||||
import { Content, ScrollEvent } from '../content/content';
|
import { Content, ScrollEvent } from '../content/content';
|
||||||
import { DomController } from '../../platform/dom-controller';
|
import { DomController } from '../../platform/dom-controller';
|
||||||
|
@ -3,9 +3,10 @@ import { IonicApp, IonicModule, InfiniteScroll, NavController } from '../../../.
|
|||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
selector: 'my-content',
|
||||||
templateUrl: 'main.html'
|
templateUrl: 'main.html'
|
||||||
})
|
})
|
||||||
export class E2EPage1 {
|
export class MyContent {
|
||||||
@ViewChild(InfiniteScroll) infiniteScroll: InfiniteScroll;
|
@ViewChild(InfiniteScroll) infiniteScroll: InfiniteScroll;
|
||||||
items: number[] = [];
|
items: number[] = [];
|
||||||
enabled: boolean = true;
|
enabled: boolean = true;
|
||||||
@ -42,6 +43,22 @@ export class E2EPage1 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
template: `
|
||||||
|
<ion-header>
|
||||||
|
<ion-toolbar>
|
||||||
|
<ion-title>Infinite Scroll</ion-title>
|
||||||
|
</ion-toolbar>
|
||||||
|
</ion-header>
|
||||||
|
|
||||||
|
<ion-content>
|
||||||
|
<my-content></my-content>
|
||||||
|
</ion-content>
|
||||||
|
`
|
||||||
|
})
|
||||||
|
export class E2EPage1 {}
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
template: '<ion-content><button ion-button (click)="navCtrl.pop()">Pop</button></ion-content>'
|
template: '<ion-content><button ion-button (click)="navCtrl.pop()">Pop</button></ion-content>'
|
||||||
})
|
})
|
||||||
@ -61,7 +78,8 @@ export class E2EApp {
|
|||||||
declarations: [
|
declarations: [
|
||||||
E2EApp,
|
E2EApp,
|
||||||
E2EPage1,
|
E2EPage1,
|
||||||
E2EPage2
|
E2EPage2,
|
||||||
|
MyContent
|
||||||
],
|
],
|
||||||
imports: [
|
imports: [
|
||||||
IonicModule.forRoot(E2EApp)
|
IonicModule.forRoot(E2EApp)
|
||||||
@ -70,7 +88,8 @@ export class E2EApp {
|
|||||||
entryComponents: [
|
entryComponents: [
|
||||||
E2EApp,
|
E2EApp,
|
||||||
E2EPage1,
|
E2EPage1,
|
||||||
E2EPage2
|
E2EPage2,
|
||||||
|
MyContent
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
export class AppModule {}
|
export class AppModule {}
|
||||||
|
@ -1,33 +1,21 @@
|
|||||||
<ion-header>
|
|
||||||
|
|
||||||
<ion-toolbar>
|
<p>
|
||||||
<ion-title>Infinite Scroll</ion-title>
|
InfiniteScroll is enabled: {{enabled}}
|
||||||
</ion-toolbar>
|
</p>
|
||||||
|
|
||||||
</ion-header>
|
<button ion-button (click)="toggleInfiniteScroll()" block>
|
||||||
|
Toggle InfiniteScroll Enabled
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<ion-list>
|
||||||
<ion-content>
|
<button ion-item (click)="goToPage2()" *ngFor="let item of items">
|
||||||
|
{{ item }}
|
||||||
<p>
|
|
||||||
InfiniteScroll is enabled: {{enabled}}
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<button ion-button (click)="toggleInfiniteScroll()" block>
|
|
||||||
Toggle InfiniteScroll Enabled
|
|
||||||
</button>
|
</button>
|
||||||
|
</ion-list>
|
||||||
|
|
||||||
<ion-list>
|
<ion-infinite-scroll (ionInfinite)="$event.waitFor(doInfinite())" [enabled]="enabled" threshold="100px">
|
||||||
<button ion-item (click)="goToPage2()" *ngFor="let item of items">
|
<ion-infinite-scroll-content
|
||||||
{{ item }}
|
loadingSpinner="bubbles"
|
||||||
</button>
|
loadingText="Loading more data...">
|
||||||
</ion-list>
|
</ion-infinite-scroll-content>
|
||||||
|
</ion-infinite-scroll>
|
||||||
<ion-infinite-scroll (ionInfinite)="$event.waitFor(doInfinite())" [enabled]="enabled" threshold="100px">
|
|
||||||
<ion-infinite-scroll-content
|
|
||||||
loadingSpinner="bubbles"
|
|
||||||
loadingText="Loading more data...">
|
|
||||||
</ion-infinite-scroll-content>
|
|
||||||
</ion-infinite-scroll>
|
|
||||||
|
|
||||||
</ion-content>
|
|
||||||
|
Reference in New Issue
Block a user