Support angular control flow (#15606)

Co-authored-by: dweizhe <d.weizhe@anyong.com.tw>
Co-authored-by: fisker <lionkay@gmail.com>
This commit is contained in:
authored and GitHub committed 2023-11-12 20:01:30 +08:00
1 parent 811eb0a085
commit 0176a33db4
31 files changed
+1085 -5

No files matched your search

+36
View File
@@ -0,0 +1,36 @@
<h3>&#64;if and &#64;else</h3>
<div>
<input #checkbox type="checkbox" [checked]="isChecked()" (change)="isChecked.set(checkbox.checked)" id="checkbox"/>
</div>
<div>
@if (isChecked()) {
<span>Checked</span>
}
@else {
<span>Not checked</span>
}
</div>
@if (users$ | async; as users) { {{ users.length }} }
@else if (users$ | async; as users) { {{ users.length }} }
<div *ngIf="users$ | async; as users">{{ users.length }}</div>
@else {}
@if (isDev) {}
@else if (test) {}
@if (foo( "quotes")) {}
@else if (foo( 'quotes')) {}
@if ( widthCategory !== undefined && widthCategory >
topStartToSideStartMaxSize) {
<app-component />
}
@if ( widthCategory; as item) {
}
<div *ngIf="widthCategory; as item"></div>