Angular: Support @content block (#19431)
This commit is contained in:
1 parent
aadd3ee2b8
commit
e736c0e858
5 files changed
+77
-3
No files matched your search
@@ -0,0 +1,29 @@
|
||||
#### Support `@content` block (#19431 by @fisker)
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
```html
|
||||
<!-- Input -->
|
||||
<FancyButton [label]="title">
|
||||
@content(icon) {
|
||||
<span>Icon</span>
|
||||
}
|
||||
@content(description) {
|
||||
<span>Description text</span>
|
||||
}
|
||||
<span>Other children</span>
|
||||
</FancyButton>
|
||||
|
||||
<!-- Prettier stable -->
|
||||
SyntaxError: Unexpected character "EOF" (Do you have an unescaped "{" in your template? Use "{{ '{' }}") to escape it.) (9:15)
|
||||
|
||||
<!-- Prettier main -->
|
||||
<FancyButton [label]="title">
|
||||
@content(icon) {
|
||||
<span>Icon!</span>
|
||||
}
|
||||
@content(description) {
|
||||
<span>Description text</span>
|
||||
}
|
||||
<span>Other children</span>
|
||||
</FancyButton>
|
||||
```
|
||||
Reference in new issue
Block a user