Skip to content

Commit

Permalink
chore(content): added short for angular @for
Browse files Browse the repository at this point in the history
  • Loading branch information
ywarezk committed Jan 9, 2024
1 parent 178c097 commit bec534c
Showing 1 changed file with 12 additions and 2 deletions.
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.

0 comments on commit bec534c

Please sign in to comment.