Skip to content

Commit a5f754b

Browse files
committed
docs(refresher): update angular to standalone
1 parent 2794a56 commit a5f754b

File tree

12 files changed

+40
-26
lines changed

12 files changed

+40
-26
lines changed

static/usage/v7/refresher/advanced/angular/example_component_html.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@
1111
</ion-refresher>
1212

1313
<ion-list>
14-
<ion-item [button]="true" *ngFor="let item of items">
14+
@for (item of items; track item) {
15+
<ion-item [button]="true">
1516
<ion-icon slot="start" color="primary" [name]="item.unread ? 'ellipse' : ''"></ion-icon>
1617
<ion-label>
1718
<h2>{{ item.name }}</h2>
1819
<p>New message from {{ item.name }}</p>
1920
</ion-label>
2021
</ion-item>
22+
}
2123
</ion-list>
2224
</ion-content>
2325
```

static/usage/v7/refresher/advanced/angular/example_component_ts.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ import {
1616
import { addIcons } from 'ionicons';
1717
import { ellipse } from 'ionicons/icons';
1818

19+
interface Item {
20+
name: string;
21+
unread: boolean;
22+
}
23+
1924
@Component({
2025
selector: 'app-example',
2126
templateUrl: 'example.component.html',
@@ -49,7 +54,7 @@ export class ExampleComponent {
4954
'Rachel Rabbit',
5055
'Ted Turtle',
5156
];
52-
public items = [];
57+
public items: Item[] = [];
5358

5459
constructor() {
5560
/**
@@ -68,7 +73,7 @@ export class ExampleComponent {
6873
return this.names[Math.floor(Math.random() * this.names.length)];
6974
}
7075

71-
addItems(count, unread = false) {
76+
addItems(count: number, unread = false) {
7277
for (let i = 0; i < count; i++) {
7378
this.items.unshift({
7479
name: this.chooseRandomName(),
@@ -77,10 +82,10 @@ export class ExampleComponent {
7782
}
7883
}
7984

80-
handleRefresh(event) {
85+
handleRefresh(event: CustomEvent) {
8186
setTimeout(() => {
8287
this.addItems(3, true);
83-
event.target.complete();
88+
(event.target as HTMLIonRefresherElement).complete();
8489
}, 2000);
8590
}
8691
}

static/usage/v7/refresher/basic/angular/example_component_ts.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ import {
1616
imports: [IonContent, IonHeader, IonRefresher, IonRefresherContent, IonTitle, IonToolbar],
1717
})
1818
export class ExampleComponent {
19-
handleRefresh(event) {
19+
handleRefresh(event: CustomEvent) {
2020
setTimeout(() => {
2121
// Any calls to load data go here
22-
event.target.complete();
22+
(event.target as HTMLIonRefresherElement).complete();
2323
}, 2000);
2424
}
2525
}

static/usage/v7/refresher/custom-content/angular/example_component_ts.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ import {
1616
imports: [IonContent, IonHeader, IonRefresher, IonRefresherContent, IonTitle, IonToolbar],
1717
})
1818
export class ExampleComponent {
19-
handleRefresh(event) {
19+
handleRefresh(event: CustomEvent) {
2020
setTimeout(() => {
2121
// Any calls to load data go here
22-
event.target.complete();
22+
(event.target as HTMLIonRefresherElement).complete();
2323
}, 2000);
2424
}
2525
}

static/usage/v7/refresher/custom-scroll-target/angular/example_component_ts.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ import {
1616
imports: [IonContent, IonHeader, IonRefresher, IonRefresherContent, IonTitle, IonToolbar],
1717
})
1818
export class ExampleComponent {
19-
handleRefresh(event) {
19+
handleRefresh(event: CustomEvent) {
2020
setTimeout(() => {
2121
// Any calls to load data go here
22-
event.target.complete();
22+
(event.target as HTMLIonRefresherElement).complete();
2323
}, 2000);
2424
}
2525
}

static/usage/v7/refresher/pull-properties/angular/example_component_ts.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ import {
1616
imports: [IonContent, IonHeader, IonRefresher, IonRefresherContent, IonTitle, IonToolbar],
1717
})
1818
export class ExampleComponent {
19-
handleRefresh(event) {
19+
handleRefresh(event: CustomEvent) {
2020
setTimeout(() => {
2121
// Any calls to load data go here
22-
event.target.complete();
22+
(event.target as HTMLIonRefresherElement).complete();
2323
}, 2000);
2424
}
2525
}

static/usage/v8/refresher/advanced/angular/example_component_html.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@
1111
</ion-refresher>
1212

1313
<ion-list>
14-
<ion-item [button]="true" *ngFor="let item of items">
14+
@for (item of items; track item) {
15+
<ion-item [button]="true">
1516
<ion-icon slot="start" color="primary" [name]="item.unread ? 'ellipse' : ''"></ion-icon>
1617
<ion-label>
1718
<h2>{{ item.name }}</h2>
1819
<p>New message from {{ item.name }}</p>
1920
</ion-label>
2021
</ion-item>
22+
}
2123
</ion-list>
2224
</ion-content>
2325
```

static/usage/v8/refresher/advanced/angular/example_component_ts.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ import {
1616
import { addIcons } from 'ionicons';
1717
import { ellipse } from 'ionicons/icons';
1818

19+
interface Item {
20+
name: string;
21+
unread: boolean;
22+
}
23+
1924
@Component({
2025
selector: 'app-example',
2126
templateUrl: 'example.component.html',
@@ -49,7 +54,7 @@ export class ExampleComponent {
4954
'Rachel Rabbit',
5055
'Ted Turtle',
5156
];
52-
public items = [];
57+
public items: Item[] = [];
5358

5459
constructor() {
5560
/**
@@ -68,7 +73,7 @@ export class ExampleComponent {
6873
return this.names[Math.floor(Math.random() * this.names.length)];
6974
}
7075

71-
addItems(count, unread = false) {
76+
addItems(count: number, unread = false) {
7277
for (let i = 0; i < count; i++) {
7378
this.items.unshift({
7479
name: this.chooseRandomName(),
@@ -77,10 +82,10 @@ export class ExampleComponent {
7782
}
7883
}
7984

80-
handleRefresh(event) {
85+
handleRefresh(event: CustomEvent) {
8186
setTimeout(() => {
8287
this.addItems(3, true);
83-
event.target.complete();
88+
(event.target as HTMLIonRefresherElement).complete();
8489
}, 2000);
8590
}
8691
}

static/usage/v8/refresher/basic/angular/example_component_ts.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ import {
1616
imports: [IonContent, IonHeader, IonRefresher, IonRefresherContent, IonTitle, IonToolbar],
1717
})
1818
export class ExampleComponent {
19-
handleRefresh(event) {
19+
handleRefresh(event: CustomEvent) {
2020
setTimeout(() => {
2121
// Any calls to load data go here
22-
event.target.complete();
22+
(event.target as HTMLIonRefresherElement).complete();
2323
}, 2000);
2424
}
2525
}

static/usage/v8/refresher/custom-content/angular/example_component_ts.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ import {
1616
imports: [IonContent, IonHeader, IonRefresher, IonRefresherContent, IonTitle, IonToolbar],
1717
})
1818
export class ExampleComponent {
19-
handleRefresh(event) {
19+
handleRefresh(event: CustomEvent) {
2020
setTimeout(() => {
2121
// Any calls to load data go here
22-
event.target.complete();
22+
(event.target as HTMLIonRefresherElement).complete();
2323
}, 2000);
2424
}
2525
}

0 commit comments

Comments
 (0)