diff --git a/aio/content/guide/angular-compiler-options.md b/aio/content/guide/angular-compiler-options.md
index 6775254bd8..06d3f80881 100644
--- a/aio/content/guide/angular-compiler-options.md
+++ b/aio/content/guide/angular-compiler-options.md
@@ -1,6 +1,6 @@
# Angular compiler options
-When you use [AOT compilation](guide/aot-compiler), you can control how your application is compiled by specifying *template* compiler options in the `tsconfig.json` [TypeScript configuration file](guide/typescript-configuration).
+When you use [AoT compilation](guide/aot-compiler), you can control how your application is compiled by specifying *template* compiler options in the `tsconfig.json` [TypeScript configuration file](guide/typescript-configuration).
The template options object, `angularCompilerOptions`, is a sibling to the `compilerOptions` object that supplies standard options to the TypeScript compiler.
@@ -17,7 +17,38 @@ The template options object, `angularCompilerOptions`, is a sibling to the `comp
}
}
```
-This page describes the available Angular template compiler options.
+
+{@a tsconfig-extends}
+## Configuration inheritance with extends
+
+Like the TypeScript compiler, The Angular AoT compiler also supports `extends` in the `angularCompilerOptions` section of the TypeScript configuration file, `tsconfig.json`.
+The `extends` property is at the top level, parallel to `compilerOptions` and `angularCompilerOptions`.
+
+A TypeScript configuration can inherit settings from another file using the `extends` property.
+The configuration options from the base file are loaded first, then overridden by those in the inheriting `tsconfig` file.
+
+For example:
+
+```json
+{
+ "extends": "../tsconfig.base.json",
+ "compilerOptions": {
+ "experimentalDecorators": true,
+ ...
+ },
+ "angularCompilerOptions": {
+ "fullTemplateTypeCheck": true,
+ "preserveWhitespaces": true,
+ ...
+ }
+}
+```
+
+For more informaton, see the [TypeScript Handbook](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html).
+
+## Template options
+
+The following options are available for configuring the AoT template compiler.
### `allowEmptyCodegenFiles`
diff --git a/aio/content/guide/aot-compiler.md b/aio/content/guide/aot-compiler.md
index 5ad583d0fc..f3eb6c1dce 100644
--- a/aio/content/guide/aot-compiler.md
+++ b/aio/content/guide/aot-compiler.md
@@ -12,14 +12,39 @@ This guide explains how to specify metadata and apply available compiler options
+{@a why-aot}
+
+Here are some reasons you might want to use AOT.
+
+* *Faster rendering*
+ With AOT, the browser downloads a pre-compiled version of the application.
+ The browser loads executable code so it can render the application immediately, without waiting to compile the app first.
+
+* *Fewer asynchronous requests*
+ The compiler _inlines_ external HTML templates and CSS style sheets within the application JavaScript,
+ eliminating separate ajax requests for those source files.
+
+* *Smaller Angular framework download size*
+ There's no need to download the Angular compiler if the app is already compiled.
+ The compiler is roughly half of Angular itself, so omitting it dramatically reduces the application payload.
+
+* *Detect template errors earlier*
+ The AOT compiler detects and reports template binding errors during the build step
+ before users can see them.
+
+* *Better security*
+ AOT compiles HTML templates and components into JavaScript files long before they are served to the client.
+ With no templates to read and no risky client-side HTML or JavaScript evaluation,
+ there are fewer opportunities for injection attacks.
+
{@a overview}
-## Angular compilation
+## Choosing a compiler
Angular offers two ways to compile your application:
-1. **_Just-in-Time_ (JIT)**, which compiles your app in the browser at runtime.
-1. **_Ahead-of-Time_ (AOT)**, which compiles your app at build time.
+* **_Just-in-Time_ (JIT)**, which compiles your app in the browser at runtime.
+* **_Ahead-of-Time_ (AOT)**, which compiles your app at build time.
JIT compilation is the default when you run the [`ng build`](cli/build) (build only) or [`ng serve`](cli/serve) (build and serve locally) CLI commands:
@@ -45,52 +70,11 @@ See the [CLI command reference](cli) and [Building and serving Angular apps](gui
-{@a why-aot}
+## How AOT works
-## Why compile with AOT?
-
-*Faster rendering*
-
-With AOT, the browser downloads a pre-compiled version of the application.
-The browser loads executable code so it can render the application immediately, without waiting to compile the app first.
-
-*Fewer asynchronous requests*
-
-The compiler _inlines_ external HTML templates and CSS style sheets within the application JavaScript,
-eliminating separate ajax requests for those source files.
-
-*Smaller Angular framework download size*
-
-There's no need to download the Angular compiler if the app is already compiled.
-The compiler is roughly half of Angular itself, so omitting it dramatically reduces the application payload.
-
-*Detect template errors earlier*
-
-The AOT compiler detects and reports template binding errors during the build step
-before users can see them.
-
-*Better security*
-
-AOT compiles HTML templates and components into JavaScript files long before they are served to the client.
-With no templates to read and no risky client-side HTML or JavaScript evaluation,
-there are fewer opportunities for injection attacks.
-
-## Controlling app compilation
-
-When you use the Angular AOT compiler, you can control your app compilation in two ways:
-
-* By [specifying Angular metadata](#metadata-aot), as described below.
-
-* By providing options in the `tsconfig.json` [TypeScript configuration file](guide/typescript-configuration). See [Angular compiler options](guide/angular-compiler-options).
-
-
-{@a metadata-aot}
-## Specifying Angular metadata
-
-Angular metadata tells Angular how to construct instances of your application classes and interact with them at runtime.
-The Angular **AOT compiler** extracts **metadata** to interpret the parts of the application that Angular is supposed to manage.
-
-You can specify the metadata with **decorators** such as `@Component()` and `@Input()` or implicitly in the constructor declarations of these decorated classes.
+The Angular AOT compiler extracts **metadata** to interpret the parts of the application that Angular is supposed to manage.
+You can specify the metadata explicitly in **decorators** such as `@Component()` and `@Input()`, or implicitly in the constructor declarations of the decorated classes.
+The metadata tells Angular how to construct instances of your application classes and interact with them at runtime.
In the following example, the `@Component()` metadata object and the class constructor tell Angular how to create and display an instance of `TypicalComponent`.
@@ -108,26 +92,45 @@ export class TypicalComponent {
The Angular compiler extracts the metadata _once_ and generates a _factory_ for `TypicalComponent`.
When it needs to create a `TypicalComponent` instance, Angular calls the factory, which produces a new visual element, bound to a new instance of the component class with its injected dependency.
-## Metadata restrictions
+### Compilation phases
+
+There are three phases of AOT compilation.
+* Phase 1 is *code analysis*.
+ In this phase, the TypeScript compiler and *AOT collector* create a representation of the source. The collector does not attempt to interpret the metadata it collects. It represents the metadata as best it can and records errors when it detects a metadata syntax violation.
+
+* Phase 2 is *code generation*.
+ In this phase, the compiler's `StaticReflector` interprets the metadata collected in phase 1, performs additional validation of the metadata, and throws an error if it detects a metadata restriction violation.
+
+* Phase 3 is *template type checking*.
+ In this optional phase, the Angular *template compiler* uses the TypeScript compiler to validate the binding expressions in templates. You can enable this phase explicitly by setting the `fullTemplateTypeCheck` configuration option; see [Angular compiler options](guide/angular-compiler-options).
+
+
+### Metadata restrictions
You write metadata in a _subset_ of TypeScript that must conform to the following general constraints:
-1. Limit [expression syntax](#expression-syntax) to the supported subset of JavaScript.
-2. Only reference exported symbols after [code folding](#folding).
-3. Only call [functions supported](#supported-functions) by the compiler.
-4. Decorated and data-bound class members must be public.
+* Limit [expression syntax](#expression-syntax) to the supported subset of JavaScript.
+* Only reference exported symbols after [code folding](#code-folding).
+* Only call [functions supported](#supported-functions) by the compiler.
+* Decorated and data-bound class members must be public.
-The next sections elaborate on these points.
+For additional guidelines and instructions on preparing an application for AOT compilation, see [Angular: Writing AOT-friendly applications](https://medium.com/sparkles-blog/angular-writing-aot-friendly-applications-7b64c8afbe3f).
-## How AOT works
+
-It helps to think of the AOT compiler as having two phases: a code analysis phase in which it simply records a representation of the source; and a code generation phase in which the compiler's `StaticReflector` handles the interpretation as well as places restrictions on what it interprets.
+Errors in AOT compilation commonly occur because of metadata that does not conform to the compiler's requirements (as described more fully below).
+For help in understanding and resolving these problems, see [AOT Metadata Errors](guide/aot-metadata-errors).
-## Phase 1: analysis
+
+
+### Configuring AOT compilation
+
+You can provide options in the `tsconfig.json` [TypeScript configuration file](guide/typescript-configuration) that control the compilation process. See [Angular compiler options](guide/angular-compiler-options) for a complete list of available options.
+
+## Phase 1: Code analysis
The TypeScript compiler does some of the analytic work of the first phase. It emits the `.d.ts` _type definition files_ with type information that the AOT compiler needs to generate application code.
-
-At the same time, the AOT **_collector_** analyzes the metadata recorded in the Angular decorators and outputs metadata information in **`.metadata.json`** files, one per `.d.ts` file.
+At the same time, the AOT **collector** analyzes the metadata recorded in the Angular decorators and outputs metadata information in **`.metadata.json`** files, one per `.d.ts` file.
You can think of `.metadata.json` as a diagram of the overall structure of a decorator's metadata, represented as an [abstract syntax tree (AST)](https://en.wikipedia.org/wiki/Abstract_syntax_tree).
@@ -139,9 +142,9 @@ describes the JSON format as a collection of TypeScript interfaces.
{@a expression-syntax}
-### Expression syntax
+### Expression syntax limitations
-The _collector_ only understands a subset of JavaScript.
+The AOT collector only understands a subset of JavaScript.
Define metadata objects with the following limited syntax:
+ The compiler only supports metadata for the [Angular decorators in the `@angular/core` module](api/core#decorators).
-
-
- Decorator |
- Module |
-
-
- Attribute |
- @angular/core |
-
-
- Component |
- @angular/core |
-
-
- ContentChild |
- @angular/core |
-
-
- ContentChildren |
- @angular/core |
-
-
- Directive |
- @angular/core |
-
-
- Host |
- @angular/core |
-
-
- HostBinding |
- @angular/core |
-
-
- HostListner |
- @angular/core |
-
-
- Inject |
- @angular/core |
-
-
- Injectable |
- @angular/core |
-
-
- Input |
- @angular/core |
-
-
- NgModule |
- @angular/core |
-
-
- Optional |
- @angular/core |
-
-
- Output |
- @angular/core |
-
-
- Pipe |
- @angular/core |
-
-
- Self |
- @angular/core |
-
-
- SkipSelf |
- @angular/core |
-
-
- ViewChild |
- @angular/core |
-
+* Function calls
-
+ Factory functions must be exported, named functions.
+ The AOT compiler does not support lambda expressions ("arrow functions") for factory functions.
+{@a function-calls}
+### Functions and static method calls
-
-### Macro-functions and macro-static methods
-
-The compiler also supports _macros_ in the form of functions or static
-methods that return an expression.
+The collector accepts any function or static method that contains a single `return` statement.
+The compiler, however, only supports macros in the form of functions or static methods that return an *expression*.
For example, consider the following function:
@@ -596,10 +514,6 @@ The compiler treats this usage as if you had written:
})
export class TypicalModule {}
```
-
-The collector is simplistic in its determination of what qualifies as a macro
-function; it can only contain a single `return` statement.
-
The Angular [`RouterModule`](api/router/RouterModule) exports two macro static methods, `forRoot` and `forChild`, to help declare root and child routes.
Review the [source code](https://github.com/angular/angular/blob/master/packages/router/src/router_module.ts#L139 "RouterModule.forRoot source code")
for these methods to see how macros can simplify configuration of complex [NgModules](guide/ngmodules).
@@ -608,11 +522,10 @@ for these methods to see how macros can simplify configuration of complex [NgMod
### Metadata rewriting
-The compiler treats object literals containing the fields `useClass`, `useValue`, `useFactory`, and `data` specially. The compiler converts the expression initializing one of these fields into an exported variable, which replaces the expression. This process of rewriting these expressions removes all the restrictions on what can be in them because
+The compiler treats object literals containing the fields `useClass`, `useValue`, `useFactory`, and `data` specially, converting the expression initializing one of these fields into an exported variable that replaces the expression.
+This process of rewriting these expressions removes all the restrictions on what can be in them because
the compiler doesn't need to know the expression's value—it just needs to be able to generate a reference to the value.
-
-
You might write something like:
```typescript
@@ -627,7 +540,6 @@ export class TypicalModule {}
```
Without rewriting, this would be invalid because lambdas are not supported and `TypicalServer` is not exported.
-
To allow this, the compiler automatically rewrites this to something like:
```typescript
@@ -643,535 +555,26 @@ export const ɵ0 = () => new TypicalServer();
export class TypicalModule {}
```
-This allows the compiler to generate a reference to `ɵ0` in the
-factory without having to know what the value of `ɵ0` contains.
+This allows the compiler to generate a reference to `ɵ0` in the factory without having to know what the value of `ɵ0` contains.
-The compiler does the rewriting during the emit of the `.js` file. This doesn't rewrite the `.d.ts` file, however, so TypeScript doesn't recognize it as being an export. Thus, it does not pollute the ES module's exported API.
+The compiler does the rewriting during the emit of the `.js` file.
+It does not, however, rewrite the `.d.ts` file, so TypeScript doesn't recognize it as being an export. and it does not interfere with the ES module's exported API.
-## Metadata errors
-
-The following are metadata errors you may encounter, with explanations and suggested corrections.
-
-[Expression form not supported](#expression-form-not-supported)
-[Reference to a local (non-exported) symbol](#reference-to-a-local-symbol)
-[Only initialized variables and constants](#only-initialized-variables)
-[Reference to a non-exported class](#reference-to-a-non-exported-class)
-[Reference to a non-exported function](#reference-to-a-non-exported-function)
-[Function calls are not supported](#function-calls-not-supported)
-[Destructured variable or constant not supported](#destructured-variable-not-supported)
-[Could not resolve type](#could-not-resolve-type)
-[Name expected](#name-expected)
-[Unsupported enum member name](#unsupported-enum-member-name)
-[Tagged template expressions are not supported](#tagged-template-expressions-not-supported)
-[Symbol reference expected](#symbol-reference-expected)
-
-
-
-Expression form not supported
-
-The compiler encountered an expression it didn't understand while evaluating Angular metadata.
-
-Language features outside of the compiler's [restricted expression syntax](#expression-syntax)
-can produce this error, as seen in the following example:
-
-```
-// ERROR
-export class Fooish { ... }
-...
-const prop = typeof Fooish; // typeof is not valid in metadata
- ...
- // bracket notation is not valid in metadata
- { provide: 'token', useValue: { [prop]: 'value' } };
- ...
-```
-
-You can use `typeof` and bracket notation in normal application code.
-You just can't use those features within expressions that define Angular metadata.
-
-Avoid this error by sticking to the compiler's [restricted expression syntax](#expression-syntax)
-when writing Angular metadata
-and be wary of new or unusual TypeScript features.
-
-
-
-{@a reference-to-a-local-symbol}
-Reference to a local (non-exported) symbol
-
-
-
-_Reference to a local (non-exported) symbol 'symbol name'. Consider exporting the symbol._
-
-
-
-The compiler encountered a referenced to a locally defined symbol that either wasn't exported or wasn't initialized.
-
-Here's a `provider` example of the problem.
-
-```
-// ERROR
-let foo: number; // neither exported nor initialized
-
-@Component({
- selector: 'my-component',
- template: ... ,
- providers: [
- { provide: Foo, useValue: foo }
- ]
-})
-export class MyComponent {}
-```
-The compiler generates the component factory, which includes the `useValue` provider code, in a separate module. _That_ factory module can't reach back to _this_ source module to access the local (non-exported) `foo` variable.
-
-You could fix the problem by initializing `foo`.
-
-```
-let foo = 42; // initialized
-```
-
-The compiler will [fold](#folding) the expression into the provider as if you had written this.
-
-```
- providers: [
- { provide: Foo, useValue: 42 }
- ]
-```
-
-Alternatively, you can fix it by exporting `foo` with the expectation that `foo` will be assigned at runtime when you actually know its value.
-
-```
-// CORRECTED
-export let foo: number; // exported
-
-@Component({
- selector: 'my-component',
- template: ... ,
- providers: [
- { provide: Foo, useValue: foo }
- ]
-})
-export class MyComponent {}
-```
-
-Adding `export` often works for variables referenced in metadata such as `providers` and `animations` because the compiler can generate _references_ to the exported variables in these expressions. It doesn't need the _values_ of those variables.
-
-Adding `export` doesn't work when the compiler needs the _actual value_
-in order to generate code.
-For example, it doesn't work for the `template` property.
-
-```
-// ERROR
-export let someTemplate: string; // exported but not initialized
-
-@Component({
- selector: 'my-component',
- template: someTemplate
-})
-export class MyComponent {}
-```
-
-The compiler needs the value of the `template` property _right now_ to generate the component factory.
-The variable reference alone is insufficient.
-Prefixing the declaration with `export` merely produces a new error, "[`Only initialized variables and constants can be referenced`](#only-initialized-variables)".
-
-
-
-{@a only-initialized-variables}
-Only initialized variables and constants
-
-
-
-_Only initialized variables and constants can be referenced because the value of this variable is needed by the template compiler._
-
-
-
-The compiler found a reference to an exported variable or static field that wasn't initialized.
-It needs the value of that variable to generate code.
-
-The following example tries to set the component's `template` property to the value of
-the exported `someTemplate` variable which is declared but _unassigned_.
-
-```
-// ERROR
-export let someTemplate: string;
-
-@Component({
- selector: 'my-component',
- template: someTemplate
-})
-export class MyComponent {}
-```
-
-You'd also get this error if you imported `someTemplate` from some other module and neglected to initialize it there.
-
-```
-// ERROR - not initialized there either
-import { someTemplate } from './config';
-
-@Component({
- selector: 'my-component',
- template: someTemplate
-})
-export class MyComponent {}
-```
-
-The compiler cannot wait until runtime to get the template information.
-It must statically derive the value of the `someTemplate` variable from the source code
-so that it can generate the component factory, which includes
-instructions for building the element based on the template.
-
-To correct this error, provide the initial value of the variable in an initializer clause _on the same line_.
-
-```
-// CORRECTED
-export let someTemplate = 'Greetings from Angular
';
-
-@Component({
- selector: 'my-component',
- template: someTemplate
-})
-export class MyComponent {}
-```
-
-
-
-Reference to a non-exported class
-
-
-
-_Reference to a non-exported class . Consider exporting the class._
-
-
-
-Metadata referenced a class that wasn't exported.
-
-For example, you may have defined a class and used it as an injection token in a providers array
-but neglected to export that class.
-
-```
-// ERROR
-abstract class MyStrategy { }
-
- ...
- providers: [
- { provide: MyStrategy, useValue: ... }
- ]
- ...
-```
-
-Angular generates a class factory in a separate module and that
-factory [can only access exported classes](#exported-symbols).
-To correct this error, export the referenced class.
-
-```
-// CORRECTED
-export abstract class MyStrategy { }
-
- ...
- providers: [
- { provide: MyStrategy, useValue: ... }
- ]
- ...
-```
-
-
-Reference to a non-exported function
-
-Metadata referenced a function that wasn't exported.
-
-For example, you may have set a providers `useFactory` property to a locally defined function that you neglected to export.
-
-```
-// ERROR
-function myStrategy() { ... }
-
- ...
- providers: [
- { provide: MyStrategy, useFactory: myStrategy }
- ]
- ...
-```
-
-Angular generates a class factory in a separate module and that
-factory [can only access exported functions](#exported-symbols).
-To correct this error, export the function.
-
-```
-// CORRECTED
-export function myStrategy() { ... }
-
- ...
- providers: [
- { provide: MyStrategy, useFactory: myStrategy }
- ]
- ...
-```
-
-
-{@a function-calls-not-supported}
-Function calls are not supported
-
-
-
-_Function calls are not supported. Consider replacing the function or lambda with a reference to an exported function._
-
-
-
-The compiler does not currently support [function expressions or lambda functions](#function-expression).
-For example, you cannot set a provider's `useFactory` to an anonymous function or arrow function like this.
-
-```
-// ERROR
- ...
- providers: [
- { provide: MyStrategy, useFactory: function() { ... } },
- { provide: OtherStrategy, useFactory: () => { ... } }
- ]
- ...
-```
-You also get this error if you call a function or method in a provider's `useValue`.
-```
-// ERROR
-import { calculateValue } from './utilities';
-
- ...
- providers: [
- { provide: SomeValue, useValue: calculateValue() }
- ]
- ...
-```
-
-To correct this error, export a function from the module and refer to the function in a `useFactory` provider instead.
-
-
-// CORRECTED
-import { calculateValue } from './utilities';
-
-export function myStrategy() { ... }
-export function otherStrategy() { ... }
-export function someValueFactory() {
- return calculateValue();
-}
- ...
- providers: [
- { provide: MyStrategy, useFactory: myStrategy },
- { provide: OtherStrategy, useFactory: otherStrategy },
- { provide: SomeValue, useFactory: someValueFactory }
- ]
- ...
-
-
-
-
-{@a destructured-variable-not-supported}
-Destructured variable or constant not supported
-
-
-
-_Referencing an exported destructured variable or constant is not supported by the template compiler. Consider simplifying this to avoid destructuring._
-
-
-
-The compiler does not support references to variables assigned by [destructuring](https://www.typescriptlang.org/docs/handbook/variable-declarations.html#destructuring).
-
-For example, you cannot write something like this:
-
-
-// ERROR
-import { configuration } from './configuration';
-
-// destructured assignment to foo and bar
-const {foo, bar} = configuration;
- ...
- providers: [
- {provide: Foo, useValue: foo},
- {provide: Bar, useValue: bar},
- ]
- ...
-
-
-To correct this error, refer to non-destructured values.
-
-
-// CORRECTED
-import { configuration } from './configuration';
- ...
- providers: [
- {provide: Foo, useValue: configuration.foo},
- {provide: Bar, useValue: configuration.bar},
- ]
- ...
-
-
-
-
-Could not resolve type
-
-The compiler encountered a type and can't determine which module exports that type.
-
-This can happen if you refer to an ambient type.
-For example, the `Window` type is an ambient type declared in the global `.d.ts` file.
-
-You'll get an error if you reference it in the component constructor,
-which the compiler must statically analyze.
-
-```
-// ERROR
-@Component({ })
-export class MyComponent {
- constructor (private win: Window) { ... }
-}
-```
-TypeScript understands ambient types so you don't import them.
-The Angular compiler does not understand a type that you neglect to export or import.
-
-In this case, the compiler doesn't understand how to inject something with the `Window` token.
-
-Do not refer to ambient types in metadata expressions.
-
-If you must inject an instance of an ambient type,
-you can finesse the problem in four steps:
-
-1. Create an injection token for an instance of the ambient type.
-1. Create a factory function that returns that instance.
-1. Add a `useFactory` provider with that factory function.
-1. Use `@Inject` to inject the instance.
-
-Here's an illustrative example.
-
-
-// CORRECTED
-import { Inject } from '@angular/core';
-
-export const WINDOW = new InjectionToken('Window');
-export function _window() { return window; }
-
-@Component({
- ...
- providers: [
- { provide: WINDOW, useFactory: _window }
- ]
-})
-export class MyComponent {
- constructor (@Inject(WINDOW) private win: Window) { ... }
-}
-
-
-The `Window` type in the constructor is no longer a problem for the compiler because it
-uses the `@Inject(WINDOW)` to generate the injection code.
-
-Angular does something similar with the `DOCUMENT` token so you can inject the browser's `document` object (or an abstraction of it, depending upon the platform in which the application runs).
-
-
-import { Inject } from '@angular/core';
-import { DOCUMENT } from '@angular/platform-browser';
-
-@Component({ ... })
-export class MyComponent {
- constructor (@Inject(DOCUMENT) private doc: Document) { ... }
-}
-
-
-
-Name expected
-
-The compiler expected a name in an expression it was evaluating.
-This can happen if you use a number as a property name as in the following example.
-
-```
-// ERROR
-provider: [{ provide: Foo, useValue: { 0: 'test' } }]
-```
-
-Change the name of the property to something non-numeric.
-
-```
-// CORRECTED
-provider: [{ provide: Foo, useValue: { '0': 'test' } }]
-```
-
-
-
-Unsupported enum member name
-
-Angular couldn't determine the value of the [enum member](https://www.typescriptlang.org/docs/handbook/enums.html)
-that you referenced in metadata.
-
-The compiler can understand simple enum values but not complex values such as those derived from computed properties.
-
-
-// ERROR
-enum Colors {
- Red = 1,
- White,
- Blue = "Blue".length // computed
-}
-
- ...
- providers: [
- { provide: BaseColor, useValue: Colors.White } // ok
- { provide: DangerColor, useValue: Colors.Red } // ok
- { provide: StrongColor, useValue: Colors.Blue } // bad
- ]
- ...
-
-
-Avoid referring to enums with complicated initializers or computed properties.
-
-
-
-{@a tagged-template-expressions-not-supported}
-Tagged template expressions are not supported
-
-
-
-_Tagged template expressions are not supported in metadata._
-
-
-
-The compiler encountered a JavaScript ES2015 [tagged template expression](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#Tagged_template_literals) such as,
-```
-// ERROR
-const expression = 'funky';
-const raw = String.raw`A tagged template ${expression} string`;
- ...
- template: '' + raw + '
'
- ...
-```
-[`String.raw()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/raw)
-is a _tag function_ native to JavaScript ES2015.
-
-The AOT compiler does not support tagged template expressions; avoid them in metadata expressions.
-
-
-
-Symbol reference expected
-
-The compiler expected a reference to a symbol at the location specified in the error message.
-
-This error can occur if you use an expression in the `extends` clause of a class.
-
-
-
{@a binding-expression-validation}
- ## Phase 3: binding expression validation
+## Phase 3: Template type checking
- In the validation phase, the Angular template compiler uses the TypeScript compiler to validate the
- binding expressions in templates. Enable this phase explicitly by adding the compiler
- option `"fullTemplateTypeCheck"` in the `"angularCompilerOptions"` of the project's `tsconfig.json` (see
- [Angular Compiler Options](guide/angular-compiler-options)).
+In the template type-checking phase, the Angular template compiler uses the TypeScript compiler to validate the binding expressions in templates.
+Enable this phase explicitly by adding the compiler option `"fullTemplateTypeCheck"` in the `"angularCompilerOptions"` of the project's `tsconfig.json`
+(see [Angular Compiler Options](guide/angular-compiler-options)).
- Template validation produces error messages when a type error is detected in a template binding
- expression, similar to how type errors are reported by the TypeScript compiler against code in a `.ts`
- file.
+Template validation produces error messages when a type error is detected in a template binding
+expression, similar to how type errors are reported by the TypeScript compiler against code in a `.ts`
+file.
- For example, consider the following component:
+For example, consider the following component:
- ```typescript
+```typescript
@Component({
selector: 'my-component',
template: '{{person.addresss.street}}'
@@ -1179,36 +582,36 @@ Chuck: After reviewing your PR comment I'm still at a loss. See [comment there](
class MyComponent {
person?: Person;
}
- ```
+```
- This will produce the following error:
+This produces the following error:
- ```
+```
my.component.ts.MyComponent.html(1,1): : Property 'addresss' does not exist on type 'Person'. Did you mean 'address'?
- ```
+ ```
- The file name reported in the error message, `my.component.ts.MyComponent.html`, is a synthetic file
- generated by the template compiler that holds contents of the `MyComponent` class template.
- Compiler never writes this file to disk. The line and column numbers are relative to the template string
- in the `@Component` annotation of the class, `MyComponent` in this case. If a component uses
- `templateUrl` instead of `template`, the errors are reported in the HTML file referenced by the
- `templateUrl` instead of a synthetic file.
+The file name reported in the error message, `my.component.ts.MyComponent.html`, is a synthetic file
+generated by the template compiler that holds contents of the `MyComponent` class template.
+The compiler never writes this file to disk.
+The line and column numbers are relative to the template string in the `@Component` annotation of the class, `MyComponent` in this case.
+If a component uses `templateUrl` instead of `template`, the errors are reported in the HTML file referenced by the `templateUrl` instead of a synthetic file.
- The error location is the beginning of the text node that contains the interpolation expression with
- the error. If the error is in an attribute binding such as `[value]="person.address.street"`, the error
- location is the location of the attribute that contains the error.
+The error location is the beginning of the text node that contains the interpolation expression with the error.
+If the error is in an attribute binding such as `[value]="person.address.street"`, the error
+location is the location of the attribute that contains the error.
- The validation uses the TypeScript type checker and the options supplied to the TypeScript compiler to control
- how detailed the type validation is. For example, if the `strictTypeChecks` is specified, the error ```my.component.ts.MyComponent.html(1,1): : Object is possibly 'undefined'``` is reported as well as the above error message.
+The validation uses the TypeScript type checker and the options supplied to the TypeScript compiler to control how detailed the type validation is.
+For example, if the `strictTypeChecks` is specified, the error
+```my.component.ts.MyComponent.html(1,1): : Object is possibly 'undefined'```
+is reported as well as the above error message.
- ### Type narrowing
+### Type narrowing
- The expression used in an `ngIf` directive is used to narrow type unions in the Angular
- template compiler, the same way the `if` expression does in TypeScript. For example, to avoid
- `Object is possibly 'undefined'` error in the template above, modify it to only emit the
- interpolation if the value of `person` is initialized as shown below:
+The expression used in an `ngIf` directive is used to narrow type unions in the Angular
+template compiler, the same way the `if` expression does in TypeScript.
+For example, to avoid `Object is possibly 'undefined'` error in the template above, modify it to only emit the interpolation if the value of `person` is initialized as shown below:
- ```typescript
+```typescript
@Component({
selector: 'my-component',
template: ' {{person.addresss.street}} '
@@ -1216,39 +619,29 @@ Chuck: After reviewing your PR comment I'm still at a loss. See [comment there](
class MyComponent {
person?: Person;
}
- ```
+```
- Using `*ngIf` allows the TypeScript compiler to infer that the `person` used in the
- binding expression will never be `undefined`.
+Using `*ngIf` allows the TypeScript compiler to infer that the `person` used in the binding expression will never be `undefined`.
- #### Custom `ngIf` like directives
+#### Custom `ngIf` like directives
- Directives that behave like `*ngIf` can declare that they want the same treatment by including
- a static member marker that is a signal to the template compiler to treat them
- like `*ngIf`. This static member for `*ngIf` is:
+Directives that behave like `*ngIf` can declare that they want the same treatment by including a static member marker that is a signal to the template compiler to treat them like `*ngIf`. This static member for `*ngIf` is:
- ```typescript
+```typescript
public static ngIfUseIfTypeGuard: void;
- ```
+```
- This declares that the input property `ngIf` of the `NgIf` directive should be treated as a
- guard to the use of its template, implying that the template will only be instantiated if
- the `ngIf` input property is true.
+This declares that the input property `ngIf` of the `NgIf` directive should be treated as a guard to the use of its template, implying that the template will only be instantiated if the `ngIf` input property is true.
- ### Non-null type assertion operator
+### Non-null type assertion operator
- Use the [non-null type assertion operator](guide/template-syntax#non-null-assertion-operator)
- to suppress the `Object is possibly 'undefined'` error when it is inconvenient to use
- `*ngIf` or when some constraint in the component ensures that the expression is always
- non-null when the binding expression is interpolated.
+Use the [non-null type assertion operator](guide/template-syntax#non-null-assertion-operator) to suppress the `Object is possibly 'undefined'` error when it is inconvenient to use `*ngIf` or when some constraint in the component ensures that the expression is always non-null when the binding expression is interpolated.
- In the following example, the `person` and `address` properties are always set together,
- implying that `address` is always non-null if `person` is non-null. There is no convenient
- way to describe this constraint to TypeScript and the template compiler, but the error
- is suppressed in the example by using `address!.street`.
+In the following example, the `person` and `address` properties are always set together, implying that `address` is always non-null if `person` is non-null.
+There is no convenient way to describe this constraint to TypeScript and the template compiler, but the error is suppressed in the example by using `address!.street`.
- ```typescript
+```typescript
@Component({
selector: 'my-component',
template: ' {{person.name}} lives on {{address!.street}} '
@@ -1262,15 +655,13 @@ Chuck: After reviewing your PR comment I'm still at a loss. See [comment there](
this.address = address;
}
}
- ```
+```
- The non-null assertion operator should be used sparingly as refactoring of the component
- might break this constraint.
+The non-null assertion operator should be used sparingly as refactoring of the component might break this constraint.
- In this example it is recommended to include the checking of `address`
- in the `*ngIf`as shown below:
+In this example it is recommended to include the checking of `address` in the `*ngIf`as shown below:
- ```typescript
+```typescript
@Component({
selector: 'my-component',
template: ' {{person.name}} lives on {{address.street}} '
@@ -1284,19 +675,16 @@ Chuck: After reviewing your PR comment I'm still at a loss. See [comment there](
this.address = address;
}
}
- ```
+```
- ### Disabling type checking using `$any()`
+### Disabling type checking using `$any()`
- Disable checking of a binding expression by surrounding the expression
- in a call to the [`$any()` cast pseudo-function](guide/template-syntax).
- The compiler treats it as a cast to the `any` type just like in TypeScript when a ``
- or `as any` cast is used.
+Disable checking of a binding expression by surrounding the expression in a call to the [`$any()` cast pseudo-function](guide/template-syntax).
+The compiler treats it as a cast to the `any` type just like in TypeScript when a `` or `as any` cast is used.
- In the following example, the error `Property addresss does not exist` is suppressed
- by casting `person` to the `any` type.
+In the following example, the error `Property addresss does not exist` is suppressed by casting `person` to the `any` type.
- ```typescript
+```typescript
@Component({
selector: 'my-component',
template: '{{$any(person).addresss.street}}'
@@ -1304,26 +692,4 @@ Chuck: After reviewing your PR comment I'm still at a loss. See [comment there](
class MyComponent {
person?: Person;
}
- ```
-
-{@a tsconfig-extends}
-## Configuration inheritance with extends
-Similar to TypeScript Compiler, Angular Compiler also supports `extends` in the `tsconfig.json` on `angularCompilerOptions`. A tsconfig file can inherit configurations from another file using the `extends` property.
- The `extends` is a top level property parallel to `compilerOptions` and `angularCompilerOptions`.
- The configuration from the base file are loaded first, then overridden by those in the inheriting config file.
- Example:
-```json
-{
- "extends": "../tsconfig.base.json",
- "compilerOptions": {
- "experimentalDecorators": true,
- ...
- },
- "angularCompilerOptions": {
- "fullTemplateTypeCheck": true,
- "preserveWhitespaces": true,
- ...
- }
-}
```
- More information about tsconfig extends can be found in the [TypeScript Handbook](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html).
diff --git a/aio/content/guide/aot-metadata-errors.md b/aio/content/guide/aot-metadata-errors.md
new file mode 100644
index 0000000000..999ddf76be
--- /dev/null
+++ b/aio/content/guide/aot-metadata-errors.md
@@ -0,0 +1,540 @@
+# AoT metadata errors
+
+The following are metadata errors you may encounter, with explanations and suggested corrections.
+
+[Expression form not supported](#expression-form-not-supported)
+[Reference to a local (non-exported) symbol](#reference-to-a-local-symbol)
+[Only initialized variables and constants](#only-initialized-variables)
+[Reference to a non-exported class](#reference-to-a-non-exported-class)
+[Reference to a non-exported function](#reference-to-a-non-exported-function)
+[Function calls are not supported](#function-calls-not-supported)
+[Destructured variable or constant not supported](#destructured-variable-not-supported)
+[Could not resolve type](#could-not-resolve-type)
+[Name expected](#name-expected)
+[Unsupported enum member name](#unsupported-enum-member-name)
+[Tagged template expressions are not supported](#tagged-template-expressions-not-supported)
+[Symbol reference expected](#symbol-reference-expected)
+
+
+
+{@a expression-form-not-supported}
+## Expression form not supported
+
+
+
+*The compiler encountered an expression it didn't understand while evaluating Angular metadata.*
+
+
+
+Language features outside of the compiler's [restricted expression syntax](guide/aot-compiler#expression-syntax)
+can produce this error, as seen in the following example:
+
+```ts
+// ERROR
+export class Fooish { ... }
+...
+const prop = typeof Fooish; // typeof is not valid in metadata
+ ...
+ // bracket notation is not valid in metadata
+ { provide: 'token', useValue: { [prop]: 'value' } };
+ ...
+```
+
+You can use `typeof` and bracket notation in normal application code.
+You just can't use those features within expressions that define Angular metadata.
+
+Avoid this error by sticking to the compiler's [restricted expression syntax](guide/aot-compiler#expression-syntax)
+when writing Angular metadata
+and be wary of new or unusual TypeScript features.
+
+
+
+{@a reference-to-a-local-symbol}
+## Reference to a local (non-exported) symbol
+
+
+
+_Reference to a local (non-exported) symbol 'symbol name'. Consider exporting the symbol._
+
+
+
+The compiler encountered a referenced to a locally defined symbol that either wasn't exported or wasn't initialized.
+
+Here's a `provider` example of the problem.
+
+```ts
+// ERROR
+let foo: number; // neither exported nor initialized
+
+@Component({
+ selector: 'my-component',
+ template: ... ,
+ providers: [
+ { provide: Foo, useValue: foo }
+ ]
+})
+export class MyComponent {}
+```
+The compiler generates the component factory, which includes the `useValue` provider code, in a separate module. _That_ factory module can't reach back to _this_ source module to access the local (non-exported) `foo` variable.
+
+You could fix the problem by initializing `foo`.
+
+```ts
+let foo = 42; // initialized
+```
+
+The compiler will [fold](guide/aot-compiler#code-folding) the expression into the provider as if you had written this.
+
+```ts
+ providers: [
+ { provide: Foo, useValue: 42 }
+ ]
+```
+
+Alternatively, you can fix it by exporting `foo` with the expectation that `foo` will be assigned at runtime when you actually know its value.
+
+```ts
+// CORRECTED
+export let foo: number; // exported
+
+@Component({
+ selector: 'my-component',
+ template: ... ,
+ providers: [
+ { provide: Foo, useValue: foo }
+ ]
+})
+export class MyComponent {}
+```
+
+Adding `export` often works for variables referenced in metadata such as `providers` and `animations` because the compiler can generate _references_ to the exported variables in these expressions. It doesn't need the _values_ of those variables.
+
+Adding `export` doesn't work when the compiler needs the _actual value_
+in order to generate code.
+For example, it doesn't work for the `template` property.
+
+```ts
+// ERROR
+export let someTemplate: string; // exported but not initialized
+
+@Component({
+ selector: 'my-component',
+ template: someTemplate
+})
+export class MyComponent {}
+```
+
+The compiler needs the value of the `template` property _right now_ to generate the component factory.
+The variable reference alone is insufficient.
+Prefixing the declaration with `export` merely produces a new error, "[`Only initialized variables and constants can be referenced`](#only-initialized-variables)".
+
+
+
+{@a only-initialized-variables}
+## Only initialized variables and constants
+
+
+
+_Only initialized variables and constants can be referenced because the value of this variable is needed by the template compiler._
+
+
+
+The compiler found a reference to an exported variable or static field that wasn't initialized.
+It needs the value of that variable to generate code.
+
+The following example tries to set the component's `template` property to the value of
+the exported `someTemplate` variable which is declared but _unassigned_.
+
+```ts
+// ERROR
+export let someTemplate: string;
+
+@Component({
+ selector: 'my-component',
+ template: someTemplate
+})
+export class MyComponent {}
+```
+
+You'd also get this error if you imported `someTemplate` from some other module and neglected to initialize it there.
+
+```ts
+// ERROR - not initialized there either
+import { someTemplate } from './config';
+
+@Component({
+ selector: 'my-component',
+ template: someTemplate
+})
+export class MyComponent {}
+```
+
+The compiler cannot wait until runtime to get the template information.
+It must statically derive the value of the `someTemplate` variable from the source code
+so that it can generate the component factory, which includes
+instructions for building the element based on the template.
+
+To correct this error, provide the initial value of the variable in an initializer clause _on the same line_.
+
+```ts
+// CORRECTED
+export let someTemplate = 'Greetings from Angular
';
+
+@Component({
+ selector: 'my-component',
+ template: someTemplate
+})
+export class MyComponent {}
+```
+
+
+
+{@a reference-to-a-non-exported-class}
+## Reference to a non-exported class
+
+
+
+_Reference to a non-exported class . Consider exporting the class._
+
+
+
+Metadata referenced a class that wasn't exported.
+
+For example, you may have defined a class and used it as an injection token in a providers array
+but neglected to export that class.
+
+```ts
+// ERROR
+abstract class MyStrategy { }
+
+ ...
+ providers: [
+ { provide: MyStrategy, useValue: ... }
+ ]
+ ...
+```
+
+Angular generates a class factory in a separate module and that
+factory [can only access exported classes](guide/aot-compiler#exported-symbols).
+To correct this error, export the referenced class.
+
+```ts
+// CORRECTED
+export abstract class MyStrategy { }
+
+ ...
+ providers: [
+ { provide: MyStrategy, useValue: ... }
+ ]
+ ...
+```
+
+
+{@a reference-to-a-non-exported-function}
+## Reference to a non-exported function
+
+
+
+*Metadata referenced a function that wasn't exported.*
+
+
+
+For example, you may have set a providers `useFactory` property to a locally defined function that you neglected to export.
+
+```ts
+// ERROR
+function myStrategy() { ... }
+
+ ...
+ providers: [
+ { provide: MyStrategy, useFactory: myStrategy }
+ ]
+ ...
+```
+
+Angular generates a class factory in a separate module and that
+factory [can only access exported functions](guide/aot-compiler#exported-symbols).
+To correct this error, export the function.
+
+```ts
+// CORRECTED
+export function myStrategy() { ... }
+
+ ...
+ providers: [
+ { provide: MyStrategy, useFactory: myStrategy }
+ ]
+ ...
+```
+
+
+{@a function-calls-not-supported}
+## Function calls are not supported
+
+
+
+_Function calls are not supported. Consider replacing the function or lambda with a reference to an exported function._
+
+
+
+The compiler does not currently support [function expressions or lambda functions](guide/aot-compiler#function-expression).
+For example, you cannot set a provider's `useFactory` to an anonymous function or arrow function like this.
+
+```ts
+// ERROR
+ ...
+ providers: [
+ { provide: MyStrategy, useFactory: function() { ... } },
+ { provide: OtherStrategy, useFactory: () => { ... } }
+ ]
+ ...
+```
+You also get this error if you call a function or method in a provider's `useValue`.
+
+```ts
+// ERROR
+import { calculateValue } from './utilities';
+
+ ...
+ providers: [
+ { provide: SomeValue, useValue: calculateValue() }
+ ]
+ ...
+```
+
+To correct this error, export a function from the module and refer to the function in a `useFactory` provider instead.
+
+```ts
+// CORRECTED
+import { calculateValue } from './utilities';
+
+export function myStrategy() { ... }
+export function otherStrategy() { ... }
+export function someValueFactory() {
+ return calculateValue();
+}
+ ...
+ providers: [
+ { provide: MyStrategy, useFactory: myStrategy },
+ { provide: OtherStrategy, useFactory: otherStrategy },
+ { provide: SomeValue, useFactory: someValueFactory }
+ ]
+ ...
+```
+
+
+
+{@a destructured-variable-not-supported}
+## Destructured variable or constant not supported
+
+
+
+_Referencing an exported destructured variable or constant is not supported by the template compiler. Consider simplifying this to avoid destructuring._
+
+
+
+The compiler does not support references to variables assigned by [destructuring](https://www.typescriptlang.org/docs/handbook/variable-declarations.html#destructuring).
+
+For example, you cannot write something like this:
+
+```ts
+// ERROR
+import { configuration } from './configuration';
+
+// destructured assignment to foo and bar
+const {foo, bar} = configuration;
+ ...
+ providers: [
+ {provide: Foo, useValue: foo},
+ {provide: Bar, useValue: bar},
+ ]
+ ...
+```
+
+To correct this error, refer to non-destructured values.
+
+```ts
+// CORRECTED
+import { configuration } from './configuration';
+ ...
+ providers: [
+ {provide: Foo, useValue: configuration.foo},
+ {provide: Bar, useValue: configuration.bar},
+ ]
+ ...
+```
+
+
+
+{@a could-not-resolve-type}
+## Could not resolve type
+
+
+
+*The compiler encountered a type and can't determine which module exports that type.*
+
+
+
+This can happen if you refer to an ambient type.
+For example, the `Window` type is an ambient type declared in the global `.d.ts` file.
+
+You'll get an error if you reference it in the component constructor,
+which the compiler must statically analyze.
+
+```ts
+// ERROR
+@Component({ })
+export class MyComponent {
+ constructor (private win: Window) { ... }
+}
+```
+TypeScript understands ambient types so you don't import them.
+The Angular compiler does not understand a type that you neglect to export or import.
+
+In this case, the compiler doesn't understand how to inject something with the `Window` token.
+
+Do not refer to ambient types in metadata expressions.
+
+If you must inject an instance of an ambient type,
+you can finesse the problem in four steps:
+
+1. Create an injection token for an instance of the ambient type.
+1. Create a factory function that returns that instance.
+1. Add a `useFactory` provider with that factory function.
+1. Use `@Inject` to inject the instance.
+
+Here's an illustrative example.
+
+```ts
+// CORRECTED
+import { Inject } from '@angular/core';
+
+export const WINDOW = new InjectionToken('Window');
+export function _window() { return window; }
+
+@Component({
+ ...
+ providers: [
+ { provide: WINDOW, useFactory: _window }
+ ]
+})
+export class MyComponent {
+ constructor (@Inject(WINDOW) private win: Window) { ... }
+}
+```
+
+The `Window` type in the constructor is no longer a problem for the compiler because it
+uses the `@Inject(WINDOW)` to generate the injection code.
+
+Angular does something similar with the `DOCUMENT` token so you can inject the browser's `document` object (or an abstraction of it, depending upon the platform in which the application runs).
+
+```ts
+import { Inject } from '@angular/core';
+import { DOCUMENT } from '@angular/platform-browser';
+
+@Component({ ... })
+export class MyComponent {
+ constructor (@Inject(DOCUMENT) private doc: Document) { ... }
+}
+```
+
+
+{@a name-expected}
+## Name expected
+
+
+
+*The compiler expected a name in an expression it was evaluating.*
+
+
+
+This can happen if you use a number as a property name as in the following example.
+
+```ts
+// ERROR
+provider: [{ provide: Foo, useValue: { 0: 'test' } }]
+```
+
+Change the name of the property to something non-numeric.
+
+```ts
+// CORRECTED
+provider: [{ provide: Foo, useValue: { '0': 'test' } }]
+```
+
+
+
+{@a unsupported-enum-member-name}
+## Unsupported enum member name
+
+
+
+*Angular couldn't determine the value of the [enum member](https://www.typescriptlang.org/docs/handbook/enums.html) that you referenced in metadata.*
+
+
+
+The compiler can understand simple enum values but not complex values such as those derived from computed properties.
+
+```ts
+// ERROR
+enum Colors {
+ Red = 1,
+ White,
+ Blue = "Blue".length // computed
+}
+
+ ...
+ providers: [
+ { provide: BaseColor, useValue: Colors.White } // ok
+ { provide: DangerColor, useValue: Colors.Red } // ok
+ { provide: StrongColor, useValue: Colors.Blue } // bad
+ ]
+ ...
+```
+
+Avoid referring to enums with complicated initializers or computed properties.
+
+
+
+{@a tagged-template-expressions-not-supported}
+## Tagged template expressions are not supported
+
+
+
+_Tagged template expressions are not supported in metadata._
+
+
+
+The compiler encountered a JavaScript ES2015 [tagged template expression](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#Tagged_template_literals) such as the following.
+
+```ts
+// ERROR
+const expression = 'funky';
+const raw = String.raw`A tagged template ${expression} string`;
+ ...
+ template: '' + raw + '
'
+ ...
+```
+[`String.raw()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/raw)
+is a _tag function_ native to JavaScript ES2015.
+
+The AoT compiler does not support tagged template expressions; avoid them in metadata expressions.
+
+
+
+{@a symbol-reference-expected}
+## Symbol reference expected
+
+
+
+*The compiler expected a reference to a symbol at the location specified in the error message.*
+
+
+
+This error can occur if you use an expression in the `extends` clause of a class.
+
+
diff --git a/aio/content/navigation.json b/aio/content/navigation.json
index d1c986c501..18236c6685 100644
--- a/aio/content/navigation.json
+++ b/aio/content/navigation.json
@@ -593,15 +593,26 @@
"hidden": true
},
{
- "url": "guide/aot-compiler",
- "title": "Ahead-of-Time Compilation",
- "tooltip": "Learn why and how to use the Ahead-of-Time (AOT) compiler."
- },
- {
- "url": "guide/angular-compiler-options",
- "title": "Compiler Options",
- "tooltip": "Configuration options for the AOT compiler."
- },
+ "title": "AoT Compiler",
+ "tooltip": "Understanding ahead-of-time compilation.",
+ "children": [
+ {
+ "url": "guide/aot-compiler",
+ "title": "Ahead-of-Time Compilation",
+ "tooltip": "Learn why and how to use the Ahead-of-Time (AoT) compiler."
+ },
+ {
+ "url": "guide/angular-compiler-options",
+ "title": "Angular Compiler Options",
+ "tooltip": "Configuring AoT compilation."
+ },
+ {
+ "url": "guide/aot-metadata-errors",
+ "title": "AoT Metadata Errors",
+ "tooltip": "Troubleshooting AoT compilation."
+ }
+ ]
+ },
{
"url": "guide/build",
"title": "Building & Serving",