Skip to content

Commit

Permalink
docs(gestures): update angular to standalone (#3928)
Browse files Browse the repository at this point in the history
  • Loading branch information
brandyscarney authored Dec 30, 2024
1 parent 04539ce commit 05f0b2b
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
```ts
import { ChangeDetectorRef, Component, ElementRef, ViewChild } from '@angular/core';
import type { GestureDetail } from '@ionic/angular';
import { GestureController, IonCard } from '@ionic/angular';
import { GestureController, IonCard, IonCardContent, IonCardHeader, IonCardSubtitle } from '@ionic/angular/standalone';
import type { GestureDetail } from '@ionic/angular/standalone';

@Component({
selector: 'app-example',
templateUrl: 'example.component.html',
styleUrls: ['example.component.css'],
imports: [IonCard, IonCardContent, IonCardHeader, IonCardSubtitle],
})
export class ExampleComponent {
@ViewChild(IonCard, { read: ElementRef }) card: ElementRef<HTMLIonCardElement>;
@ViewChild('debug', { read: ElementRef }) debug: ElementRef<HTMLParagraphElement>;
@ViewChild(IonCard, { read: ElementRef }) card!: ElementRef<HTMLIonCardElement>;
@ViewChild('debug', { read: ElementRef }) debug!: ElementRef<HTMLParagraphElement>;

isCardActive = false;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
```ts
import { Component, ElementRef, ViewChild } from '@angular/core';
import { GestureController, IonCard } from '@ionic/angular';
import { GestureController, IonCard, IonCardContent } from '@ionic/angular/standalone';

@Component({
selector: 'app-example',
templateUrl: 'example.component.html',
styleUrls: ['./example.component.css'],
imports: [IonCard, IonCardContent],
})
export class ExampleComponent {
@ViewChild('card', { read: ElementRef }) card: ElementRef<HTMLIonCardElement>;
@ViewChild('card', { read: ElementRef }) card!: ElementRef<HTMLIonCardElement>;

private currentOffset: number = 0;
private lastOnStart: number = 0;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
```ts
import { ChangeDetectorRef, Component, ElementRef, ViewChild } from '@angular/core';
import type { GestureDetail } from '@ionic/angular';
import { GestureController, IonCard } from '@ionic/angular';
import { GestureController, IonCard, IonCardContent, IonCardHeader, IonCardSubtitle } from '@ionic/angular/standalone';
import type { GestureDetail } from '@ionic/angular/standalone';

@Component({
selector: 'app-example',
templateUrl: 'example.component.html',
styleUrls: ['example.component.css'],
imports: [IonCard, IonCardContent, IonCardHeader, IonCardSubtitle],
})
export class ExampleComponent {
@ViewChild(IonCard, { read: ElementRef }) card: ElementRef<HTMLIonCardElement>;
@ViewChild('debug', { read: ElementRef }) debug: ElementRef<HTMLParagraphElement>;
@ViewChild(IonCard, { read: ElementRef }) card!: ElementRef<HTMLIonCardElement>;
@ViewChild('debug', { read: ElementRef }) debug!: ElementRef<HTMLParagraphElement>;

isCardActive = false;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
```ts
import { Component, ElementRef, ViewChild } from '@angular/core';
import { GestureController, IonCard } from '@ionic/angular';
import { GestureController, IonCard, IonCardContent } from '@ionic/angular/standalone';

@Component({
selector: 'app-example',
templateUrl: 'example.component.html',
styleUrls: ['./example.component.css'],
imports: [IonCard, IonCardContent],
})
export class ExampleComponent {
@ViewChild('card', { read: ElementRef }) card: ElementRef<HTMLIonCardElement>;
@ViewChild('card', { read: ElementRef }) card!: ElementRef<HTMLIonCardElement>;

private currentOffset: number = 0;
private lastOnStart: number = 0;
Expand Down

0 comments on commit 05f0b2b

Please sign in to comment.