You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# All compiler tests
cargo test -p angular-compiler
# All compiler-cli tests
cargo test -p angular-compiler-cli
# Specific test suite
cargo test -p angular-compiler ml_parser
cargo test -p angular-compiler expression_parser
🛠️ Recent Improvements
December 2024 (Latest)
Control Flow - @for Loops
Feature
Status
Notes
Basic @for
✅
@for (item of items; track item.id)
Context Variables
✅
$index, $count, $first, $last, $even, $odd
Local Aliases
✅
let idx = $index, first = $first
Nested @for
✅
Multiple levels with correct context
@empty Block
✅
Fallback when collection is empty
Track By Function
✅
track item.id or track trackFn($index, item)
Event Handlers
⚠️
Works but has view hierarchy issue in nested conditionals
Known Issue: @for inside @if/@else blocks may cause nextContext() to return undefined in event handlers. Investigating.
Control Flow - @if Conditionals
Feature
Status
Notes
Basic @if
✅
@if (condition) { ... }
@else Block
✅
@if (condition) { ... } @else { ... }
@else if
✅
Chained conditionals
Template Chaining
✅
conditionalCreate() fluent API
NgFor Directive (*ngFor)
✅ Full Template Syntax: *ngFor="let item of items; index as i; first as isFirst; last as isLast; even as isEven; odd as isOdd; trackBy: trackFn"
✅ Context Variables: All loop variables ($implicit, index, count, first, last, even, odd) correctly mapped
✅ Source-Span Sorting: Attributes in consts array are sorted by their source position in the template, ensuring parity with NGTSC
✅ Nested Loops: Full support for nested *ngFor with correct view restoration
✅ Event Handlers Inside Loops: Proper getCurrentView()/restoreView() emission for event handlers within loop bodies
NgIf Directive (*ngIf)
✅ Basic Conditionals: *ngIf="condition"
✅ Else Template: *ngIf="condition; else elseTemplate" with TemplateRef extraction
✅ Then/Else Templates: *ngIf="condition; then thenTpl; else elseTpl"
✅ As Syntax: *ngIf="user$ | async as user" with local variable binding
✅ Nested NgIf: Complex nested conditionals with proper context isolation
✅ ɵɵtwoWayProperty: Property binding for two-way data flow
✅ ɵɵtwoWayBindingSet: Setter with fallback assignment
Optimizations & Parity
✅ RestoreView Optimization: Single-usage context variables are inlined (const user = restoreView().$implicit) while multi-usage retains separate statements