File tree Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,15 @@ The `IonModalToken` injection token allows you to inject a reference to the curr
19
19
20
20
Starting in ` @ionic/angular ` v8.7.0, you can use this injection token to streamline modal interactions in your Angular applications.
21
21
22
+ ## Benefits
23
+
24
+ Using injection tokens provides several advantages:
25
+
26
+ - ** Type Safety** : Full TypeScript support with proper typing for the modal element
27
+ - ** Angular Integration** : Works seamlessly with Angular's dependency injection system
28
+ - ** Simplified Code** : Eliminates the need for ` ViewChild ` queries or manual element references
29
+ - ** Better Testing** : Easier to mock and test components that use injection tokens
30
+
22
31
### Basic Usage
23
32
24
33
To use the ` IonModalToken ` , inject it into your component's constructor:
@@ -166,13 +175,3 @@ export class HomePage {
166
175
}
167
176
}
168
177
```
169
-
170
- ## Benefits
171
-
172
- Using injection tokens provides several advantages:
173
-
174
- - ** Type Safety** : Full TypeScript support with proper typing for the modal element
175
- - ** Angular Integration** : Works seamlessly with Angular's dependency injection system
176
- - ** Simplified Code** : Eliminates the need for ` ViewChild ` queries or manual element references
177
- - ** Better Testing** : Easier to mock and test components that use injection tokens
178
- - ** Standalone Components** : Full compatibility with Angular's standalone component architecture
You can’t perform that action at this time.
0 commit comments