Open History to see the last commit
1<div>
2 <h1>Posts</h1>
3 @switch (postsQuery.status()) {
4 @case ('pending') {
5 Loading...
6 }
7 @case ('error') {
8 Error: {{ postsQuery.error()?.message }}
9 }
10 @default {
11 <div class="todo-container">
12 @for (post of postsQuery.data(); track post.id) {
13 <p>
14 <!-- We can access the query data here to show bold links for-->
15 <!-- ones that are cached-->
16 <a
17 routerLink="post/{{ post.id }}"
18 [style]="
19 queryClient.getQueryData(['post', post.id])
20 ? {
21 fontWeight: 'bold',
22 color: 'green'
23 }
24 : {}
25 "
26 >{{ post.title }}</a
27 >
28 </p>
29 }
30 </div>
31 }
32 }
33 <div>
34 @if (postsQuery.isFetching()) {
35 Background Updating...
36 }
37 </div>
38</div>