Angular: Format @content(name) -> @content (name) to align with other block syntax (#19499)

This commit is contained in:
fisker Cheung authored and GitHub committed 2026-06-30 09:05:20 +08:00
1 parent abed2c22db
commit 2e92ac0ee2
4 files changed
+112 -10

No files matched your search

@@ -90,17 +90,65 @@ parsers: ["angular"]
<span>Other children</span>
</FancyButton>
<FancyButton [label]="title">
@content (items; let item, index) {
<span>#{{index}}: {{item}}</span>
}
</FancyButton>
<FancyList>
@content (renderHeader; let _) {
<span>Header Content</span>
}
</FancyList>
<FancyTable>
@content (renderRow; let row, idx, isLast) {
<span>{{ idx }} - {{ row }} (Last: {{ isLast }})</span>
}
</FancyTable>
<DynamicIf [injector]="injector" [cond]="visible">
@content (children; let result) {
<child>{{ result }}</child>
}
</DynamicIf>
=====================================output=====================================
<FancyButton [label]="title">
@content(icon) {
@content (icon) {
<span>Icon!</span>
}
@content(description) {
@content (description) {
<span>Description text</span>
}
<span>Other children</span>
</FancyButton>
<FancyButton [label]="title">
@content (items; let item, index) {
<span>#{{ index }}: {{ item }}</span>
}
</FancyButton>
<FancyList>
@content (renderHeader; let _) {
<span>Header Content</span>
}
</FancyList>
<FancyTable>
@content (renderRow; let row, idx, isLast) {
<span>{{ idx }} - {{ row }} (Last: {{ isLast }})</span>
}
</FancyTable>
<DynamicIf [injector]="injector" [cond]="visible">
@content (children; let result) {
<child>{{ result }}</child>
}
</DynamicIf>
================================================================================
`;
@@ -7,3 +7,27 @@
}
<span>Other children</span>
</FancyButton>
<FancyButton [label]="title">
@content (items; let item, index) {
<span>#{{index}}: {{item}}</span>
}
</FancyButton>
<FancyList>
@content (renderHeader; let _) {
<span>Header Content</span>
}
</FancyList>
<FancyTable>
@content (renderRow; let row, idx, isLast) {
<span>{{ idx }} - {{ row }} (Last: {{ isLast }})</span>
}
</FancyTable>
<DynamicIf [injector]="injector" [cond]="visible">
@content (children; let result) {
<child>{{ result }}</child>
}
</DynamicIf>