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
3
votes
1 answer

What is the default compilation for Angular 5? (AOT or JIT)

On Angular's website, I read that the default compilation is JIT: https://angular.io/guide/aot-compiler I guess when it's on the official Angular website, it has to be JIT but on many other pages, I read that AOT is the default compilation in…
BlueCat
  • 673
  • 4
  • 16
  • 27
3
votes
2 answers

Is it possible to import a component without a module

I am wanting to import a component into another component in Angular 4.4.6. This may end up being just a theoretical answer, which is fine. Just figured I would reach out here to see if anyone is doing this. I typically would just create a module…
BSchnitzel
  • 136
  • 2
  • 15
3
votes
1 answer

Angular Cli and AOT issues

I use Angular CLI 1.4.1 in my project and want to build using AOT compilation. However I faced two issues: 1) I have Shop module with Registration component. In the registration.component.css I added line @import…
Sergiy
  • 1,854
  • 4
  • 22
  • 34
3
votes
1 answer

How to do AOT with Angular-CLI in Angular application?

Building an Angular4 project and trying to figure out how and do we need to do AOT with Angular-CLI since it runs Webpack2 behind the scenes and webpack can give us production build using ng build. So do we need to do AOT with CLI or not? Also when…
Peter
  • 10,492
  • 21
  • 82
  • 132
3
votes
0 answers

Webpack + Angular4 AoT ERROR in Expected 'styles' to be an array of strings

I'm having an error when running my Webpack3 and Angular4 AoT (only happens in AoT). The error I receive is ERROR in Expected 'styles' to be an array of strings.. I've tried several of the other methods suggested here…
amcdnl
  • 8,470
  • 12
  • 63
  • 99
3
votes
0 answers

Dynamic host name and aot

I want to bind a dynamic class name on a component host with this kind of syntax : @Component({ host: { [`[class.${classNames()}]`]: 'true', }, selector: '...', templateUrl: '...', }) When I try to build with angular-cli in AOT mode,…
Yoann Augen
  • 1,966
  • 3
  • 21
  • 39
2
votes
1 answer

How do I resolve "JIT Compiler Unavailable" with Angular 13?

I am working on a server-side routing assignment with Angular v13 and Express. The first page is a login screen that validates an ID and then directs to a home page. When I try to run my application with 'npm run localhost' I cannot get it to load,…
2
votes
4 answers

Error: The pipe 'async' could not be found! after AOT & IVY update

The project that I am working on just recently for upgraded to AOT compliance and since that happened, I am having issues with | async pipe when used in HTML. For example my HTML code looks like following:
Lost
  • 12,007
  • 32
  • 121
  • 193
2
votes
0 answers
2
votes
1 answer

Angular ignores file-loader in AOT build

I'm currently trying to build a documentation website in Angular. Docs will be written in markdown and displayed through the ngx-markdown plugin. Everything works fine on a JIT build, but an AOT build always removes the markdown files. This is how I…
Marlex
  • 43
  • 1
  • 5
2
votes
1 answer

Angular 8 lazy loading routes from custom library broken at runtime when project build with AOT

I was intent to access some lazy-loaded routes defined in a custom extended library. Everything was alright until I'm wanted to build a production package (AOT active). The build passed, but when I'm trying to reach a route I get this error in the…
Joffrey K
  • 185
  • 9
2
votes
2 answers

ngClass and ngIf condition fail to compile when aot is set to true

I have a div with a ngClass condition:
And a similar div with a ngIf condition:
Below is the NbActive…
PMerlet
  • 2,568
  • 4
  • 23
  • 39
2
votes
0 answers

AOT Build error : Function calls are not supported in decorators

I've got a problem and I don't know how to solve it, I already read a lot of posts about the error but I'm still stuck. I used nebular/auth package to create mine and nebular package works perfectly ! I'm using angular to create a library. This…
Joe Allen
  • 1,267
  • 4
  • 24
  • 41
2
votes
0 answers

Angular 4: Debug the AOT build process

Angular version: 4.3.2 Node: v8.11.2 TypeScript: 2.3.3 While creating the AOT build using , I am facing issue as follows: Error in (some index.ngfactory.ts file with path having $$_gendir): Argument of type 'string' is not assignable to parameter of…
Sujit Singh
  • 921
  • 1
  • 10
  • 20
2
votes
2 answers

Why won't aot compiler error on missing property?

With the following code: template
Wilhelmina Lohan
  • 2,803
  • 2
  • 29
  • 58
1 2
3
11 12