-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(content): added short for angular @for
- Loading branch information
Showing
1 changed file
with
12 additions
and
2 deletions.
There are no files selected for viewing
14 changes: 12 additions & 2 deletions
14
...ent/en/course/angular/best-practices/new-control-flow-syntax/for/video/short.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,17 @@ | ||
|
||
- If you're using Angular version 17 you should stop using `*ngFor` | ||
Editor type `*ngFor` on screen and do an X | ||
**Editor: type `*ngFor` on screen and do an X** | ||
|
||
- Angular 17 is shipped with a new control flow syntax and there is a better way to loop on iterables in your angular templates | ||
|
||
- In the new `@for` `track` is mandatory with a simpler api to optimize | ||
- So stop using *ngFor and instead use the new `@for` syntax in your angular templates | ||
**Editor: type `@for` and a v checkmark** | ||
|
||
There are benefits for using the new syntax: | ||
- better performance | ||
- easier to see the boundaries of the loop - **Editor should highlight the curly brackets** | ||
- track function is mandatory with an easier api - **Editor should highlight the track part** | ||
- Support for `@empty` block on edge cases where the iterable is empty null or undefined. - **Editor should highlight the empty block** | ||
|
||
Check out our complete `@for` guide and a coding playground to play with the new syntax | ||
link in the description. |