-
Hello, {{ user.firstName }}!
+ @if (user$ | async; as user) {
+
Hello, {{ user.firstName }}!
+ }
+
-
- 0">
- -
-
{{ movie.title }}
-
-
-
+ @if (movies$ | async; as movies) {
+ @if (movies.length > 0) {
+
+ @for (movie of movies; track $index) {
+ -
+
{{ movie.title }}
+
+ }
+
+ }
+ }
diff --git a/examples/with-angular/src/app/app.component.ts b/examples/with-angular/src/app/app.component.ts
index 39e2f4f..265db02 100644
--- a/examples/with-angular/src/app/app.component.ts
+++ b/examples/with-angular/src/app/app.component.ts
@@ -1,27 +1,23 @@
import { Component, inject } from '@angular/core'
-import { Movie, User } from './models'
+import { Movie } from './models'
import { MovieService } from './movie.service'
import { UserService } from './user.service'
-import { AsyncPipe, NgFor, NgIf } from '@angular/common'
+import { AsyncPipe } from '@angular/common'
import { Observable, map } from 'rxjs'
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
standalone: true,
- imports: [NgIf, NgFor, AsyncPipe],
+ imports: [AsyncPipe],
})
export class AppComponent {
userService = inject(UserService)
movieService = inject(MovieService)
- user$: Observable