mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
fix(angular): export RefresherPullEnd types (#30991)
Issue number: internal --------- ## What is the current behavior? Currently, the 8.8 refresher events are not exported to Angular ## What is the new behavior? With this change, we export the new events and also add Angular tests to validate that they work and will continue working in the future. ## Does this introduce a breaking change? - [ ] Yes - [X] No
This commit is contained in:
@@ -32,6 +32,7 @@ export const routes: Routes = [
|
||||
{ path: 'providers', loadComponent: () => import('../providers/providers.component').then(c => c.ProvidersComponent) },
|
||||
{ path: 'overlay-controllers', loadComponent: () => import('../overlay-controllers/overlay-controllers.component').then(c => c.OverlayControllersComponent) },
|
||||
{ path: 'button', loadComponent: () => import('../button/button.component').then(c => c.ButtonComponent) },
|
||||
{ path: 'refresher', loadComponent: () => import('../refresher/refresher.component').then(c => c.RefresherComponent) },
|
||||
{ path: 'reorder-group', loadComponent: () => import('../reorder-group/reorder-group.component').then(c => c.ReorderGroupComponent) },
|
||||
{ path: 'icon', loadComponent: () => import('../icon/icon.component').then(c => c.IconComponent) },
|
||||
{ path: 'split-pane', redirectTo: '/standalone/split-pane/inbox', pathMatch: 'full' },
|
||||
|
||||
@@ -33,6 +33,11 @@
|
||||
Inputs Test
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
<ion-item routerLink="/standalone/refresher">
|
||||
<ion-label>
|
||||
Refresher Test
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
<ion-item routerLink="/standalone/reorder-group">
|
||||
<ion-label>
|
||||
Reorder Group Test
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
import { Component } from "@angular/core";
|
||||
import { IonContent, IonHeader, IonItem, IonLabel, IonList, IonRefresher, IonRefresherContent, IonTitle, IonToolbar } from '@ionic/angular/standalone';
|
||||
import { RefresherCustomEvent, RefresherPullEndCustomEvent } from "@ionic/angular";
|
||||
|
||||
@Component({
|
||||
selector: 'app-refresher',
|
||||
template: `
|
||||
<ion-header>
|
||||
<ion-toolbar>
|
||||
<ion-title>Refresher Test</ion-title>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
<ion-content>
|
||||
<ion-refresher
|
||||
slot="fixed"
|
||||
(ionPullStart)="onPullStart()"
|
||||
(ionRefresh)="onRefresh($event)"
|
||||
(ionPullEnd)="onPullEnd($event)"
|
||||
>
|
||||
<ion-refresher-content></ion-refresher-content>
|
||||
</ion-refresher>
|
||||
|
||||
<ion-list>
|
||||
<ion-item>
|
||||
<ion-label>
|
||||
ionPullStart count: <span id="pull-start-count">{{ pullStartCount }}</span>
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
<ion-item>
|
||||
<ion-label>
|
||||
ionRefresh count: <span id="refresh-count">{{ refreshCount }}</span>
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
<ion-item>
|
||||
<ion-label>
|
||||
ionPullEnd count: <span id="pull-end-count">{{ pullEndCount }}</span>
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
<ion-item>
|
||||
<ion-label>
|
||||
ionPullEnd reason: <span id="pull-end-reason">{{ pullEndReason }}</span>
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
</ion-content>
|
||||
`,
|
||||
standalone: true,
|
||||
imports: [IonContent, IonHeader, IonItem, IonLabel, IonList, IonRefresher, IonRefresherContent, IonTitle, IonToolbar]
|
||||
})
|
||||
export class RefresherComponent {
|
||||
pullStartCount = 0;
|
||||
refreshCount = 0;
|
||||
pullEndCount = 0;
|
||||
pullEndReason = '';
|
||||
|
||||
onPullStart() {
|
||||
this.pullStartCount++;
|
||||
}
|
||||
|
||||
onRefresh(event: RefresherCustomEvent) {
|
||||
this.refreshCount++;
|
||||
event.target.complete();
|
||||
}
|
||||
|
||||
onPullEnd(event: RefresherPullEndCustomEvent) {
|
||||
this.pullEndCount++;
|
||||
this.pullEndReason = event.detail.reason;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user