Skip to content
Source
Sign inSign up
TanStack/query
Open History to see the last commit

app.component.ts

56 lines1.2 KB

1import { Component } from '@angular/core'
2import { PostsComponent } from './components/posts.component'
3​
4@Component({
5 selector: 'app-root',
6 imports: [PostsComponent],
7 template: `
8 <main class="page">
9 <header class="hero">
10 <p class="eyebrow">Angular SSR</p>
11 <h1>Server-rendered posts with TanStack Query</h1>
12 <p class="lede">
13 The first render comes from the server. Angular then hydrates the app
14 on the client and TanStack Query continues from a fresh client cache.
15 </p>
16 </header>
17​
18 <posts />
19 </main>
20 `,
21 styles: `
22 .page {
23 max-width: 960px;
24 margin: 0 auto;
25 padding: 48px 20px 72px;
26 }
27​
28 .hero {
29 margin-bottom: 32px;
30 }
31​
32 .eyebrow {
33 margin: 0 0 8px;
34 font-size: 12px;
35 font-weight: 700;
36 letter-spacing: 0.12em;
37 text-transform: uppercase;
38 color: #9b5c00;
39 }
40​
41 h1 {
42 margin: 0 0 12px;
43 font-size: clamp(2.2rem, 5vw, 4rem);
44 line-height: 1;
45 }
46​
47 .lede {
48 max-width: 640px;
49 margin: 0;
50 font-size: 1rem;
51 line-height: 1.6;
52 color: #4b5563;
53 }
54 `,
55})
56export class AppComponent {}