Skip to content

Commit 3744a18

Browse files
committed
Update code example
1 parent 9a3edde commit 3744a18

File tree

4 files changed

+62
-30
lines changed

4 files changed

+62
-30
lines changed

changelog_unreleased/angular/18593.md

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,29 @@
33
<!-- prettier-ignore -->
44
```html
55
<!-- Input -->
6-
@switch (foo) {
7-
@case (0)
8-
@case (1) {
9-
<div>case 0 or 1</div>
6+
@switch (userRole) {
7+
@case ('admin')
8+
@case ('moderator') {
9+
<p>Welcome, boss! Full access.</p>
1010
}
11+
@case ('user') { <p>Standard access</p> }
12+
@default { <p>Guest view</p> }
1113
}
1214

1315
<!-- Prettier stable -->
1416
SyntaxError: Incomplete block "case". If you meant to write the @ character, you should use the "&#64;" HTML entity instead. (2:3)
1517

1618
<!-- Prettier main -->
17-
@switch (foo) {
18-
@case (0)
19-
@case (1) {
20-
<div>case 0 or 1</div>
19+
@switch (userRole) {
20+
@case ("admin")
21+
@case ("moderator") {
22+
<p>Welcome, boss! Full access.</p>
23+
}
24+
@case ("user") {
25+
<p>Standard access</p>
26+
}
27+
@default {
28+
<p>Guest view</p>
2129
}
2230
}
2331
```

changelog_unreleased/angular/18596.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,23 @@
33
<!-- prettier-ignore -->
44
```html
55
<!-- Input -->
6-
<component
7-
[a]="[ ...a]"
8-
[b]="{...bar }"
9-
[c]="call( ...baz)"
6+
<MyComponent
7+
[array]="[ ...foo, ...bar]"
8+
[object]="{...bar, ...extra }"
9+
[call]="call( ...baz)"
1010
/>
1111

1212
<!-- Prettier stable -->
13-
<component [a]="[ ...a]" [b]="{...bar }" [c]="call( ...baz)" />
13+
<MyComponent
14+
[array]="[ ...foo, ...bar]"
15+
[object]="{...bar, ...extra }"
16+
[call]="call( ...baz)"
17+
/>
1418

1519
<!-- Prettier main -->
16-
<component [a]="[...a]" [b]="{ ...bar }" [c]="call(...baz)" />
20+
<MyComponent
21+
[array]="[...foo, ...bar]"
22+
[object]="{ ...bar, ...extra }"
23+
[call]="call(...baz)"
24+
/>
1725
```

changelog_unreleased/blog-post-intro.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
authors: "fisker"
3-
title: "Prettier 3.8: Angular v21.1 support"
3+
title: "Prettier 3.8: Support for Angular v21.1"
44
---
55

66
We're excited to announce that Prettier now fully supports the fresh features landing in Angular v21.1 (released today 🎉)!

website/blog/2026-01-14-3.8.0.md

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
authors: "fisker"
3-
title: "Prettier 3.8: Angular v21.1 support"
3+
title: "Prettier 3.8: Support for Angular v21.1"
44
---
55

66
We're excited to announce that Prettier now fully supports the fresh features landing in Angular v21.1 (released today 🎉)!
@@ -24,21 +24,29 @@ If you find Prettier valuable and want to help us keep pace with fast-moving fra
2424
<!-- prettier-ignore -->
2525
```html
2626
<!-- Input -->
27-
@switch (foo) {
28-
@case (0)
29-
@case (1) {
30-
<div>case 0 or 1</div>
27+
@switch (userRole) {
28+
@case ('admin')
29+
@case ('moderator') {
30+
<p>Welcome, boss! Full access.</p>
3131
}
32+
@case ('user') { <p>Standard access</p> }
33+
@default { <p>Guest view</p> }
3234
}
3335

3436
<!-- Prettier 3.7 -->
3537
SyntaxError: Incomplete block "case". If you meant to write the @ character, you should use the "&#64;" HTML entity instead. (2:3)
3638

3739
<!-- Prettier 3.8 -->
38-
@switch (foo) {
39-
@case (0)
40-
@case (1) {
41-
<div>case 0 or 1</div>
40+
@switch (userRole) {
41+
@case ("admin")
42+
@case ("moderator") {
43+
<p>Welcome, boss! Full access.</p>
44+
}
45+
@case ("user") {
46+
<p>Standard access</p>
47+
}
48+
@default {
49+
<p>Guest view</p>
4250
}
4351
}
4452
```
@@ -48,17 +56,25 @@ SyntaxError: Incomplete block "case". If you meant to write the @ character, you
4856
<!-- prettier-ignore -->
4957
```html
5058
<!-- Input -->
51-
<component
52-
[a]="[ ...a]"
53-
[b]="{...bar }"
54-
[c]="call( ...baz)"
59+
<MyComponent
60+
[array]="[ ...foo, ...bar]"
61+
[object]="{...bar, ...extra }"
62+
[call]="call( ...baz)"
5563
/>
5664

5765
<!-- Prettier 3.7 -->
58-
<component [a]="[ ...a]" [b]="{...bar }" [c]="call( ...baz)" />
66+
<MyComponent
67+
[array]="[ ...foo, ...bar]"
68+
[object]="{...bar, ...extra }"
69+
[call]="call( ...baz)"
70+
/>
5971

6072
<!-- Prettier 3.8 -->
61-
<component [a]="[...a]" [b]="{ ...bar }" [c]="call(...baz)" />
73+
<MyComponent
74+
[array]="[...foo, ...bar]"
75+
[object]="{ ...bar, ...extra }"
76+
[call]="call(...baz)"
77+
/>
6278
```
6379

6480
## Other Changes

0 commit comments

Comments
 (0)