mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 12:29:55 +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 { DomController } from '../../platform/dom-controller';
|
||||
|
@ -3,9 +3,10 @@ import { IonicApp, IonicModule, InfiniteScroll, NavController } from '../../../.
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'my-content',
|
||||
templateUrl: 'main.html'
|
||||
})
|
||||
export class E2EPage1 {
|
||||
export class MyContent {
|
||||
@ViewChild(InfiniteScroll) infiniteScroll: InfiniteScroll;
|
||||
items: number[] = [];
|
||||
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({
|
||||
template: '<ion-content><button ion-button (click)="navCtrl.pop()">Pop</button></ion-content>'
|
||||
})
|
||||
@ -61,7 +78,8 @@ export class E2EApp {
|
||||
declarations: [
|
||||
E2EApp,
|
||||
E2EPage1,
|
||||
E2EPage2
|
||||
E2EPage2,
|
||||
MyContent
|
||||
],
|
||||
imports: [
|
||||
IonicModule.forRoot(E2EApp)
|
||||
@ -70,7 +88,8 @@ export class E2EApp {
|
||||
entryComponents: [
|
||||
E2EApp,
|
||||
E2EPage1,
|
||||
E2EPage2
|
||||
E2EPage2,
|
||||
MyContent
|
||||
]
|
||||
})
|
||||
export class AppModule {}
|
||||
|
@ -1,33 +1,21 @@
|
||||
<ion-header>
|
||||
|
||||
<ion-toolbar>
|
||||
<ion-title>Infinite Scroll</ion-title>
|
||||
</ion-toolbar>
|
||||
<p>
|
||||
InfiniteScroll is enabled: {{enabled}}
|
||||
</p>
|
||||
|
||||
</ion-header>
|
||||
<button ion-button (click)="toggleInfiniteScroll()" block>
|
||||
Toggle InfiniteScroll Enabled
|
||||
</button>
|
||||
|
||||
|
||||
<ion-content>
|
||||
|
||||
<p>
|
||||
InfiniteScroll is enabled: {{enabled}}
|
||||
</p>
|
||||
|
||||
<button ion-button (click)="toggleInfiniteScroll()" block>
|
||||
Toggle InfiniteScroll Enabled
|
||||
<ion-list>
|
||||
<button ion-item (click)="goToPage2()" *ngFor="let item of items">
|
||||
{{ item }}
|
||||
</button>
|
||||
</ion-list>
|
||||
|
||||
<ion-list>
|
||||
<button ion-item (click)="goToPage2()" *ngFor="let item of items">
|
||||
{{ item }}
|
||||
</button>
|
||||
</ion-list>
|
||||
|
||||
<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>
|
||||
<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>
|
||||
|
Reference in New Issue
Block a user