Skip to content

Commit

Permalink
chore: Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
manthanank authored Dec 2, 2024
1 parent 2f9f89b commit 1cef8a9
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ This repository contains a list of resources to learn Angular. It includes tutor
- [Auditing Angular applications](#auditing-angular-applications)
- [Standalone Components](#standalone-components)
- [Angular Signals](#angular-signals)
- [Control Flow](#control-flow)
- [Angular Animations](#angular-animations)
- [Installing Angular Animations](#installing-angular-animations)
- [Angular Universal](#angular-universal)
Expand Down Expand Up @@ -5497,6 +5498,65 @@ export class AppComponent implements OnInit {

[Back to top⤴️](#table-of-contents)

## Control Flow

Conditionally display content with @if, @else-if and @else

```html
@if (a > b) {
<p>{{a}} is greater than {{b}}</p>
}
```

```html
@if (a > b) {
{{a}} is greater than {{b}}
} @else if (b > a) {
{{a}} is less than {{b}}
} @else {
{{a}} is equal to {{b}}
}
```

Repeat content with the @for block

```html
@for (item of items; track item.id) {
{{ item.name }}
}
```

Providing a fallback for @for blocks with the @empty block

```html
@for (item of items; track item.name) {
<li> {{ item.name }}</li>
} @empty {
<li aria-hidden="true"> There are no items. </li>
}
```

Conditionally display content with the @switch block

```html
@switch (userPermissions) {
@case ('admin') {
<app-admin-dashboard />
}
@case ('reviewer') {
<app-reviewer-dashboard />
}
@case ('editor') {
<app-editor-dashboard />
}
@default {
<app-viewer-dashboard />
}
}
```

[Back to top⤴️](#table-of-contents)

## Angular Animations

Angular's animation system is built on CSS functionality in order to animate any property that the browser considers animatable. These properties includes positions, sizes, transforms, colors, borders etc. The Angular modules for animations are @angular/animations and @angular/platform-browser.
Expand Down

0 comments on commit 1cef8a9

Please sign in to comment.