InterviewHubPRO
Section Overview
Q86

Question 86 of 283

Part 4: JIT vs AOT Compilation, Metadata & TypeScript (76 - 100)

30%
Angular & Signals (283 Qs)•Part 4: JIT vs AOT Compilation, Metadata & TypeScript (76 - 100)

Can I use any javascript feature for expression syntax in AOT?

No, the AOT collector understands a subset of (or limited) JavaScript features. If an expression uses unsupported syntax, the collector writes an error node to the .metadata.json file. Later point of time, the compiler reports an error if it needs that piece of metadata to generate the application code.

Practical Code Example

text
// Expression syntax in AOT:
// Only a subset of JavaScript is supported in templates (no new, ++, --, assignment operators, or bitwise operators).