Skip to content

Commit 05f0b2b

Browse files
docs(gestures): update angular to standalone (#3928)
1 parent 04539ce commit 05f0b2b

File tree

4 files changed

+16
-12
lines changed

4 files changed

+16
-12
lines changed

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
```ts
22
import { ChangeDetectorRef, Component, ElementRef, ViewChild } from '@angular/core';
3-
import type { GestureDetail } from '@ionic/angular';
4-
import { GestureController, IonCard } from '@ionic/angular';
3+
import { GestureController, IonCard, IonCardContent, IonCardHeader, IonCardSubtitle } from '@ionic/angular/standalone';
4+
import type { GestureDetail } from '@ionic/angular/standalone';
55

66
@Component({
77
selector: 'app-example',
88
templateUrl: 'example.component.html',
99
styleUrls: ['example.component.css'],
10+
imports: [IonCard, IonCardContent, IonCardHeader, IonCardSubtitle],
1011
})
1112
export class ExampleComponent {
12-
@ViewChild(IonCard, { read: ElementRef }) card: ElementRef<HTMLIonCardElement>;
13-
@ViewChild('debug', { read: ElementRef }) debug: ElementRef<HTMLParagraphElement>;
13+
@ViewChild(IonCard, { read: ElementRef }) card!: ElementRef<HTMLIonCardElement>;
14+
@ViewChild('debug', { read: ElementRef }) debug!: ElementRef<HTMLParagraphElement>;
1415

1516
isCardActive = false;
1617

static/usage/v7/gestures/double-click/angular/example_component_ts.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
```ts
22
import { Component, ElementRef, ViewChild } from '@angular/core';
3-
import { GestureController, IonCard } from '@ionic/angular';
3+
import { GestureController, IonCard, IonCardContent } from '@ionic/angular/standalone';
44

55
@Component({
66
selector: 'app-example',
77
templateUrl: 'example.component.html',
88
styleUrls: ['./example.component.css'],
9+
imports: [IonCard, IonCardContent],
910
})
1011
export class ExampleComponent {
11-
@ViewChild('card', { read: ElementRef }) card: ElementRef<HTMLIonCardElement>;
12+
@ViewChild('card', { read: ElementRef }) card!: ElementRef<HTMLIonCardElement>;
1213

1314
private currentOffset: number = 0;
1415
private lastOnStart: number = 0;

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
```ts
22
import { ChangeDetectorRef, Component, ElementRef, ViewChild } from '@angular/core';
3-
import type { GestureDetail } from '@ionic/angular';
4-
import { GestureController, IonCard } from '@ionic/angular';
3+
import { GestureController, IonCard, IonCardContent, IonCardHeader, IonCardSubtitle } from '@ionic/angular/standalone';
4+
import type { GestureDetail } from '@ionic/angular/standalone';
55

66
@Component({
77
selector: 'app-example',
88
templateUrl: 'example.component.html',
99
styleUrls: ['example.component.css'],
10+
imports: [IonCard, IonCardContent, IonCardHeader, IonCardSubtitle],
1011
})
1112
export class ExampleComponent {
12-
@ViewChild(IonCard, { read: ElementRef }) card: ElementRef<HTMLIonCardElement>;
13-
@ViewChild('debug', { read: ElementRef }) debug: ElementRef<HTMLParagraphElement>;
13+
@ViewChild(IonCard, { read: ElementRef }) card!: ElementRef<HTMLIonCardElement>;
14+
@ViewChild('debug', { read: ElementRef }) debug!: ElementRef<HTMLParagraphElement>;
1415

1516
isCardActive = false;
1617

static/usage/v8/gestures/double-click/angular/example_component_ts.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
```ts
22
import { Component, ElementRef, ViewChild } from '@angular/core';
3-
import { GestureController, IonCard } from '@ionic/angular';
3+
import { GestureController, IonCard, IonCardContent } from '@ionic/angular/standalone';
44

55
@Component({
66
selector: 'app-example',
77
templateUrl: 'example.component.html',
88
styleUrls: ['./example.component.css'],
9+
imports: [IonCard, IonCardContent],
910
})
1011
export class ExampleComponent {
11-
@ViewChild('card', { read: ElementRef }) card: ElementRef<HTMLIonCardElement>;
12+
@ViewChild('card', { read: ElementRef }) card!: ElementRef<HTMLIonCardElement>;
1213

1314
private currentOffset: number = 0;
1415
private lastOnStart: number = 0;

0 commit comments

Comments
 (0)