Questions tagged [angular2-aot]

Use angular2-aot for questions related to the Angular2 ahead-of-time compiler, which allows developers to deploy pre-compiled JavaScript code and HTML5 markup to the browser rather than TypeScript and Angular templates.

References

431 questions
0
votes
0 answers

Ng2 Nativescript Webpack - ERROR in Could not resolve module @ angular/core

I have angular2 Nativescript project where I have implemented lazy loading. I am now trying to implement webpack with AOT as per the directions given by nativescript - here. Accordingly, I installed the plugin : nativescript-dev-webpack and . Now…
0
votes
1 answer

Angular CLI build file size output shown not matching with actual on disk

I am using Angular CLI (1.2.6) and Angular(4.3.2) and running following command ng serve --aot --prod --proxy-config config/proxy.config.json Or ng build --aot --prod --proxy-config config/proxy.config.json If you see below output…
Viraj
  • 1,360
  • 3
  • 18
  • 38
0
votes
1 answer

how to make lodash work with angular4 aot

What is the correct way to import lodash with systemjs.config.js. My AOT is failing due to lodash. My project is a component library based on https://github.com/filipesilva/angular-quickstart-lib I am using in package.json "lodash": "4.17.4" …
tushar
  • 21
  • 5
0
votes
1 answer

Angular4 + AoT and two projects with common code results in duplicate declarations error

I have an Angular4 project that I've developed which is split into two main projects: the main application that most of our end-users hit and a management application that privileged users hit. These apps both share some common code. Here's the…
0
votes
1 answer

Ngx\clipboard Not working with Aot and Rollup

I have tried to implement aot in my app but While building my app with aot and rollup gets this error.I have used ngx-clipboard. 'ngx-clipboard/src/index' is imported by wwwroot\app\aot\app\app.module.ngfactory.js, but could not be resolved ΓÇô …
user3505487
  • 95
  • 2
  • 6
0
votes
1 answer

Angular build breaks when using --prod-flag

My Angular 4 build using angular-cli runs through and I can start the app, but a lot of components do not load properly. My console is filled with these error messages: Expected function name "for", was "" Expected function name "keyFor", was…
tommueller
  • 2,358
  • 2
  • 32
  • 44
0
votes
2 answers

Angular AOT compiled app not tree shaking as expected

I have a module (MyCommonModule) with common components, services, etc that I plan to share between different angular applications. This is an example of a simple app, that only imports MyCommonModule (but doesn't reference any of it in AppComponent…
Joel
  • 8,502
  • 11
  • 66
  • 115
0
votes
0 answers

AOT giving errors like module not found?

I am trying to use AOT in my project. I have created a tsconfig-aot.json file as follows { "compilerOptions": { "baseUrl": "", "declaration": false, "emitDecoratorMetadata": true, "experimentalDecorators": true, "lib": [ "es2016", …
hilda_sonica_vish
  • 727
  • 3
  • 10
  • 31
0
votes
1 answer

Angular CLI - AOT error during ng build

I created a application using Angular CLI and it works fine with the JIT compilation. I felt i need to make my application much faster so I planned to convert the application from JIT to AOT. I followed the instructions which is being mentioned by…
skid
  • 958
  • 4
  • 13
  • 29
0
votes
1 answer

Does Ahead-of-Time Compilation need angular-cli as a production dependency?

Going from the official instructions found here https://angular.io/guide/aot-compiler, it recommends installing the following npm dependencies with the command: npm install @angular/compiler-cli @angular/platform-server --save This adds both…
nciao
  • 581
  • 4
  • 22
0
votes
1 answer

How to do AOT compilation properly in Angular

I am a bit confused by reading the doc about AOT. And I quote: You can compile the app in the browser, at runtime, as the application loads, using the just-in-time (JIT) compiler. This is the standard development approach shown throughout the…
Hao
  • 6,291
  • 9
  • 39
  • 88
0
votes
0 answers

Dynamic styling and AoT compilation

I'm currently working on a massive website with three different stylesheets (basically color changes). After AoT compilation, I want my UI to dynamically switch to one of those stylesheets. So far, I can get the parameter which indicates what…
arsrobota
  • 15
  • 6
0
votes
1 answer

Rollup AOT error: "A module cannot import itself"

I am using ng-lightning in my Angular project, when running AOT I get the following error, for one of the modules in ng-lightning aot\node_modules\ng-lightning\popovers\popover.ngfactory.js (10:0) A module cannot import itself .. …
Yuvals
  • 3,094
  • 5
  • 32
  • 60
0
votes
0 answers

AOT build error with BrowserAnimationsModule in platform-browser

I'm currently working with Angular 4 and also apply Ahead-of-time compilation to reduce the amount of the boostrap time to my application. Everything is working fine but there is only one trouble when I try to apply some transition animation between…
Alex Bui
  • 41
  • 4
0
votes
1 answer

How to load different html files for jit and aot in Angular?

I would like to have both just-in-time and the ahead-of-time compiler options in the same package (directory). I have different versions of: app.module.ts, main.ts, tsconfig.json and main.html files in the same directory. Can anyone tell me how to…
WOT
  • 33
  • 1
  • 4