Skip to content

Commit fb6d127

Browse files
committed
refactor(angular): moving benefits section for injection tokens
1 parent 5d6abd1 commit fb6d127

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

docs/angular/injection-tokens.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,15 @@ The `IonModalToken` injection token allows you to inject a reference to the curr
1919

2020
Starting in `@ionic/angular` v8.7.0, you can use this injection token to streamline modal interactions in your Angular applications.
2121

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+
2231
### Basic Usage
2332

2433
To use the `IonModalToken`, inject it into your component's constructor:
@@ -166,13 +175,3 @@ export class HomePage {
166175
}
167176
}
168177
```
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

0 commit comments

Comments
 (0)