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
0 answers

Unable to use async pipe in a template of dynamically generated component in dynamically generated Angular module in AOT mode

Disclaimer: this question has been inspired by "Here is what you need to know about dynamic components in Angular" post on Medium. There an author shows how one can dynamically generate both a module and a component, put the latter into the former,…
1
vote
0 answers

The AOT compilation persist if the buildOptimizer option is in false?

I'm working in a project that's require the AOT compilation but for some particular feature into the project I need to turn to false the option buildOptimizer into angular.json My question is: The AOT compilation persist if I turn to false the…
Abel Valdez
  • 2,368
  • 1
  • 16
  • 33
1
vote
0 answers

Angular 5 Template will NOT populate with --aot switch on but will without it. NO ERRORS

I have a mystery, there's not a lot of code but it regards, ANGULAR 5 and AOT. The template selector: (This is a generic name) will NOT populate with the switch: --aot. It throws NO ERRORS but will only work…
Peter The Angular Dude
  • 1,112
  • 5
  • 26
  • 53
1
vote
0 answers

Why cannot use simple array methods in exports when doing AOT build

I made quite a large Angular app (Angular 5 and Ionic 3) which I build into an Android app. During development I always used ionic cordova build, but now I want to make a good production version (which should not have the ~15 seconds white screen…
LittleOne
  • 1,077
  • 1
  • 11
  • 21
1
vote
0 answers

How does Angular AOT compilation result in fewer "Fewer asynchronous requests"

While reading the Angular AOT section in the docs it states that AOT compilation results in "Fewer asynchronous requests" . The reasoning behind this is because: "The compiler inlines external HTML templates and CSS style sheets within the…
okayilltry
  • 482
  • 1
  • 5
  • 18
1
vote
1 answer

Angular AOT compilation fails due to 'Can't construct a query for the property ..'

I'm trying to dynamically populate a table with custom components that works perfectly with JIT compilation but throws an error when using AOT. I've also tried using forwardRef on the ViewChildren() decorator but it doesn't seem to have any effect.…
1
vote
1 answer

Angular 4 main bundle is very huge (What is $_gendir?)

I have created a web application with Angular 4. In that after aot compiling main bundle size is more than 700 KB. There is something called $_gendir and app in main bundle (Saw it in source map explorer). Can someone please explain about…
Anand Kadhir
  • 233
  • 2
  • 7
1
vote
0 answers

Taking 45 minutes time to make --prod --aot build of angular2 project when number of components are large, How to resolve this?

we have implemented ANGULAR application by using Angular ~2.4.0 and webpack ^1.10.2. it was implemented by Phase 1 and Phase 2 development. after completion of Phase 1 development it tooks only 10 minutes of time to generate aot build. but the…
Thulasi
  • 193
  • 1
  • 10
1
vote
1 answer

Angular CSS3 keyFrames for animations

In an angular project we're using the following CSS properties (in scss stylesheets) to animate an element: @keyframes animationName { 0% { y: 10 } 100% { y: 500; } } .svgRectangle { animation-iteration-count: infinite; …
Florian
  • 2,796
  • 1
  • 15
  • 25
1
vote
0 answers

Conditional providers in angular module throws AOT error

I want to push a provider to my list of providers only if browser is IE. I tried like const IE = detectIE(); providers: [abcService, xyzService, (IE) ? [{provide: EVENT_MANAGER_PLUGINS, useClass:…
Hacker
  • 7,798
  • 19
  • 84
  • 154
1
vote
0 answers

@ngtools/webpack not bundling with angular6 but working fine with angular5

My angular application was earlier on Angular5 , which was working well with webpack and @ngtools/webpack to get AOT build. But after migrating to Angular6 that build is not happening i,e there is no build file in dist directory. Also there is no…
1
vote
0 answers

Function expressions are not supported in decorators or how to make an exported function

Angular 6 project fails to compile in prod with aot turned on. I know I'm supposed to turn the function expression into an exported function but with what's going on I can't get it done correctly. I looked around for people with a similar problem…
1
vote
0 answers

main-aot is missing from the typeScript compilation

I am trying to implement ngc compilation config on my angular/webpack app. I have a tsConfig-aot.json in my root folder like below. { .... "files": [ "src/app/app.module.ts", "src/app/lazy/about/about.module.ts", …
Nuru Salihu
  • 4,756
  • 17
  • 65
  • 116
1
vote
1 answer

Building AOT angular5 library feature module with .forRoot results in `Function calls are not supported in decorators`

I would like to have an angular5 feature module in a separate library. I've created a project and put the module declaration inside: @NgModule({ imports: [], declarations: [], exports: [], providers: [] }) export class ApiModule { …
1
vote
0 answers

AoT Build takes forever

I've a angular 4.1.2 project with webpack and I'm trying to setup AoT build. When I try to publish, the first build go fine, but the AoT build never ends. Its already been building for several minutes and doesn't finish. I'm trying to use AoT…
Lucas Freitas
  • 1,016
  • 4
  • 16
  • 37