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

Why Angular JIT Compiler Mode is not catching template error

I am running a simple application in angular 12.2.0 app.component.ts file: import { Component} from '@angular/core'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.css'] }) export class…
Kavar Rushikesh
  • 143
  • 1
  • 10
1
vote
0 answers

Angular 14: Create dynamic component in dynamic HTML?

I am converting a component's @Input into MathML. MathML supports embedding HTML, and I would like to inject/create a live angular component (a component wrapping an input field) inside the generated MathML at a specific place. I'm doing something…
Stefan Norberg
  • 1,137
  • 13
  • 28
1
vote
0 answers

Issues implementing Angular Dynamic Components - AOT & Change Detection

I am trying to implement an Angular library which will encapsulate the logic required to add dynamic components to the DOM. Applications that consume this library must be allowed to provide a list of Components that will be dynamic, and then define…
1
vote
1 answer

Material 8 libraries not working with AOT mode

I am using MatSelect, MatChips and many other Mat libraries but none seem to work with AOT mode enabled. Dropdowns, MatChip inputs are not responding after clicks. They are working without AOT. Below is my package.json file and code snippet for…
1
vote
2 answers

Differences between Angular compilations

When I compile my app with ng build --prod I have this error ERROR in : Cannot determine the module for class AppComponent in D:/desarrollos/PatientPortal/front/src/app/customizations/database/app.component-database.ts! Add AppComponent to the…
Ulises 2010
  • 478
  • 1
  • 6
  • 16
1
vote
0 answers

Angular 9: failed to build an angular library in v9.1.0 which dependes on other angular library

I'm upgrading my Angular library to version 9, in my project I use Angular v9.1.0. And my library relies on another internal Angular library. When I try to build my library, II got the following…
Chris Bao
  • 2,418
  • 8
  • 35
  • 62
1
vote
0 answers

"Module not found" for typescript-only library in Angular compiler

I have an Angular application that I am switching over to use the Angular compiler. This application uses a library that I also created, which was built and packaged using webpack. When I try to build the library using ng build --prod, there is an…
Hans
  • 2,448
  • 2
  • 24
  • 30
1
vote
1 answer

Can't resolve all parameters (AOT, buildOptimizer) on Staging & Prod (ng serve works)

I just upgraded from 5 to 8. It works (and really fast) when ng-serve. It also works when I do ng-build. But when I tell it to build on ng build --configuration=staging I get ERROR in Can't resolve all parameters for CandidateViewComponent…
dash
  • 387
  • 1
  • 11
1
vote
1 answer

Angular, You provided an invalid object where a stream was expected only in --aot build

In my Angular app I'm getting the error below only in aot build. You provided an invalid object where a stream was expected. You can provide an Observable, Promise, Array, or Iterable. and after debugging the ERROR saying is it's somewhere in the…
Sabir Hossain
  • 1,183
  • 1
  • 25
  • 46
1
vote
2 answers

Exporting variable in angular AoT compiler

I tried to implement dynamic configuration as can be seen in this post. Everything works in JiT compiler, but I get ERROR in Error during template compile of 'environment' Function calls are not supported in decorators but 'Environment' was…
Drifter
  • 85
  • 1
  • 7
1
vote
0 answers

Why angular app with embedded app throws an error Runtime compiler is not loaded in AOT mode?

I'm using an old gwt application in angular app. I had no better idea than past gwt app into assets dir and specify script with entry point in index.html In dev mode everything works well that's why I didn't suspect any bad thing. But after build…
vicpro
  • 428
  • 1
  • 6
  • 14
1
vote
0 answers

Dynamic Template URL in angular AOT

I am trying to dynamically load template for one of my component. Below is a code snippet I have written. This works fine in development mode. But in production it fails. Probably due to AOT. ngAfterViewInit(): void { const moduleName =…
Mahesh
  • 1,427
  • 2
  • 19
  • 42
1
vote
1 answer

AngularCompilerPlugin with multipe node_modules folders

I am working on a monorepository that houses multiple angular (v7) applications. Angular AOT compilation with webpack gives me trouble. The top-level structure looks like this: application 01 node_modules src application…
David Brem
  • 504
  • 2
  • 6
  • 16
1
vote
3 answers

Ionic 4 with angular 7, Cannot find type definition file for '@types'

I upgraded my ionic 4 project to use angular 7, everything works on debug mode, but when I try to compile for production: 'ionic cordova build android --prod', I am getting the following output: ionic-app-scripts build --prod --target cordova…
1
vote
0 answers

How do you change the interpolation characters for Angular when using Ahead-of-Time compiling?

I'm trying to use Angular's AOT compiling in VS Code. The output files will then be used in a separate application that uses Handlebars. I do not have access to edit the js that will be consuming these files. When using both Angular and…
charles082986
  • 141
  • 1
  • 3
  • 12