Questions tagged [angular-aot]

A AOT-Compiler (Ahead of time) compiles the source code before the code is executed. Unlike the JIT-Compiler (Just in time) which compiles right when the code is executed.

The Angular Ahead-of-Time (AOT) compiler converts your Angular HTML and TypeScript code into efficient JavaScript code during the build phase before the browser downloads and runs that code.

This guide explains how to build with the AOT compiler using different compiler options and how to write Angular metadata that AOT can compile.

To find more information :

176 questions
1
vote
1 answer

Angular 5 - Dynamic modules configuration

I would like to import a module in my project with a certain configuration loaded from a file, that configuration file could be modified at runtime and the application should be loaded with the new changes when the browser is refreshed. What I am…
Alejandro Morán
  • 669
  • 1
  • 13
  • 36
1
vote
1 answer

Angular 5: Unhandled promise rejection: Failed to load html file

I have an issue with Angular 5. I am trying to run my application in production mode using aot in ng serve ==> ("start": "ng serve --ssl --aot" in package.json file). However, the application cannot find the html files in this case. It works without…
Enayat
  • 3,904
  • 1
  • 33
  • 47
1
vote
0 answers

How can I create AOT-compatible "dynamic" Modules? (Error encountered resolving symbol values statically. Function calls are not supported.)

I'm building an app that will contain a number of routes, each defined as an NgModule. Each module is pretty similar, so I'd like to abstract it to a reusable function which takes a set of components, and builds a top-level @Component and…
matthewsteele
  • 1,797
  • 1
  • 15
  • 31
1
vote
1 answer

Angular 5 webpack 3 aot builds

we recently upgraded to angular 5 from angular 4. We also upgraded to webpack 3. Managed to get our aot builds to work by getting rid of main.aot.ts and pointing the to main.ts directly but we are unable to load the build. We see 'AppService is not…
ymrs
  • 141
  • 1
  • 2
  • 5
1
vote
0 answers

Angular 5 Build issue - ng serve --aot

In Angular 5.1.0-beta.2 I'm having an error using: ng serve --aot import { BrowserModule } from '@angular/platform-browser'; import { HttpClientModule } from '@angular/common/http'; import { HttpModule } from '@angular/http'; import { AppComponent…
Vladu Ionut
  • 8,075
  • 1
  • 19
  • 30
1
vote
1 answer

Angular - Can InjectionToken be used with AOT Compilation?

In my application a config object that is being injected from the window to the Angular application. To go about this I had developed something along these lines: Code Model representing the config export class AppConfig { constructor( …
Daniel Grima
  • 2,765
  • 7
  • 34
  • 58
1
vote
1 answer

Angular errorhandler include component on aot bundle

I have an errorhandler that looks like this: @Injectable() export class GlobalErrorHandler implements ErrorHandler { constructor(private injector: Injector) { } handleError(error) { const errorService = this.injector.get(ErrorService); const…
dotnet-provoke
  • 1,308
  • 14
  • 25
1
vote
0 answers

Is a "src" dir required under the top-level ng2 app dir for aot?

I'm trying to get my app running with AOT per the documentation: https://angular.io/guide/aot-compiler I execute the following AOT compile command from 'MyApp' dir: "node_modules/.bin/ngc" -p ./ng2/tsconfig-aot.json And am returned the following…
user8570495
  • 1,645
  • 5
  • 19
  • 29
1
vote
1 answer

Compiling angular 4 project using AOT compilation

I am using angular 4 along with Webpack and Yarn as a package manager and ngrx-store. Started my project using JIT and trying to move to AOT. I keep getting all kind of errors which I am solving one by one, but maybe I am missing something here…
UserED
  • 33
  • 10
1
vote
2 answers

Compilation issue after updating the angular2 to angular4

After updated version of angular4 from 2, getting the below error on compile. Error encountered resolving symbol values statically. Function calls are not supported. Consider replacing the function or lambda with a reference to an exported…
Govinda raj
  • 613
  • 3
  • 16
  • 31
1
vote
1 answer

AOT - ngc Can't resolve all parameters for Component

When I build with following JIT instructions ng build ; ng build --prod everything is ok also when I build for AOT using --aot flag, ng build --aot The app works. But when I try to compile it (AOT) using ngc I am getting below error: Can't resolve…
Franky
  • 902
  • 2
  • 11
  • 28
1
vote
0 answers

Angular AOT changes component file name adding .ngfactory creating url reference errors on include

So AOT changes the name of my components, for example my-component.component.ts to my-component.component.ngfactory.ts but then on the generated file includes the file doing so import * as import2 from './my-component.component'; which is wrong…
Agorilla
  • 323
  • 1
  • 2
  • 9
1
vote
0 answers

Angular 2/4 compile using AoT error - extendStatics

I have an application which I'm trying to compile using AoT. When I build the application I'm getting the following error: C:\test\node_modules\@angular\compiler-cli\src\diagnostics\expression_diagnostics.js:14 extendStatics(d, b); ^ TypeError:…
Daniel Grima
  • 2,765
  • 7
  • 34
  • 58
1
vote
0 answers

Angular/Cli AOT with custom library containing another node_modules folder

I'm hitting an issue with AOT compilation and custom packages. In my scenario I have an Angular/Cli project which installs my own package (Package A). Package A has a dependency on Package B which contains a service. NPM install of Package A…
1
vote
1 answer

Since Angular Material2 beta7, the style is broken for AOT setups

Since the update of Angular Material2 beta7, the styling information seems to be broken for AOT setups, due to this breaking change. The field margins seem to be gone and the underline too. Everything seems to be lined up in one line. Eventhough I…
Carli Beeli
  • 790
  • 1
  • 11
  • 26