From 05f0b2b6b065cecc12ec25e1de0f8550630daedc Mon Sep 17 00:00:00 2001 From: Brandy Carney Date: Mon, 30 Dec 2024 13:31:30 -0500 Subject: [PATCH] docs(gestures): update angular to standalone (#3928) --- .../v7/gestures/basic/angular/example_component_ts.md | 9 +++++---- .../double-click/angular/example_component_ts.md | 5 +++-- .../v8/gestures/basic/angular/example_component_ts.md | 9 +++++---- .../double-click/angular/example_component_ts.md | 5 +++-- 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/static/usage/v7/gestures/basic/angular/example_component_ts.md b/static/usage/v7/gestures/basic/angular/example_component_ts.md index 33482eca38b..609e8ecc41a 100644 --- a/static/usage/v7/gestures/basic/angular/example_component_ts.md +++ b/static/usage/v7/gestures/basic/angular/example_component_ts.md @@ -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; - @ViewChild('debug', { read: ElementRef }) debug: ElementRef; + @ViewChild(IonCard, { read: ElementRef }) card!: ElementRef; + @ViewChild('debug', { read: ElementRef }) debug!: ElementRef; isCardActive = false; diff --git a/static/usage/v7/gestures/double-click/angular/example_component_ts.md b/static/usage/v7/gestures/double-click/angular/example_component_ts.md index 08159621553..8c963786c16 100644 --- a/static/usage/v7/gestures/double-click/angular/example_component_ts.md +++ b/static/usage/v7/gestures/double-click/angular/example_component_ts.md @@ -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; + @ViewChild('card', { read: ElementRef }) card!: ElementRef; private currentOffset: number = 0; private lastOnStart: number = 0; diff --git a/static/usage/v8/gestures/basic/angular/example_component_ts.md b/static/usage/v8/gestures/basic/angular/example_component_ts.md index 33482eca38b..609e8ecc41a 100644 --- a/static/usage/v8/gestures/basic/angular/example_component_ts.md +++ b/static/usage/v8/gestures/basic/angular/example_component_ts.md @@ -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; - @ViewChild('debug', { read: ElementRef }) debug: ElementRef; + @ViewChild(IonCard, { read: ElementRef }) card!: ElementRef; + @ViewChild('debug', { read: ElementRef }) debug!: ElementRef; isCardActive = false; diff --git a/static/usage/v8/gestures/double-click/angular/example_component_ts.md b/static/usage/v8/gestures/double-click/angular/example_component_ts.md index 08159621553..8c963786c16 100644 --- a/static/usage/v8/gestures/double-click/angular/example_component_ts.md +++ b/static/usage/v8/gestures/double-click/angular/example_component_ts.md @@ -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; + @ViewChild('card', { read: ElementRef }) card!: ElementRef; private currentOffset: number = 0; private lastOnStart: number = 0;