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

Production compilation with ejected Angular 4 application produces large files

ng build --prod Angular CLI command produces highly compressed javascript files in Angular4 application. When the application is ejected using ng eject command, Angular CLI commands are gone and we are left with npm scripts( npm run build command to…
To Ka
  • 640
  • 8
  • 24
9
votes
2 answers

Angular2 - Supplied parameters do not match any signature of call target

import { Component, Input, OnChanges } from '@angular/core'; @Component({ selector: 'image-display', templateUrl: './image-display.component.html' }) export class ImageDisplayComponent implements OnChanges { @Input() image: File; @Input()…
Ajay
  • 4,199
  • 4
  • 27
  • 47
9
votes
3 answers

AOT & Roll-Up: Only bundles main.js and nothing else

I am trying to implement AOT and Rollup per https://angular.io/docs/ts/latest/cookbook/aot-compiler.html#!#tree-shaking I run rollup per:"node_modules/.bin/rollup" -c scripts/rollup-config.js and the result is a build.js file with just the entry…
Ques Tion
  • 3,365
  • 2
  • 11
  • 10
9
votes
3 answers

Angular2, AoT compilation: Cannot determine the module for component AppComponent

Summary: I am trying to use Angular2 AoT for my Angular2 application, but since I have static providers to pass some values from server to Angular2, ngc shows some errors. My problem is how to get the ngFactory files created using ngc. Details: I am…
Musa Haidari
  • 2,109
  • 5
  • 30
  • 53
8
votes
1 answer

When using AOT, changes to objects passed to forRoot are discarded when injected

Overview I am seeing odd behavior in that the properties that are added to an object through a destructuring assignment (or Object.assign) are present when passed to forRoot but are not present when injected into a service. Additionally, updates…
bygrace
  • 5,868
  • 1
  • 31
  • 58
8
votes
1 answer

Dynamic module/service configuration and AOT

I need to have some Angular services configured dynamically, depending on a runtime switch. In days before AOT, I got it to work using the following code: @NgModule({ imports: [HttpModule], providers: [] }) export class MyModule { static…
Konrad Garus
  • 53,145
  • 43
  • 157
  • 230
8
votes
2 answers

Angular 2 Bootstrapping Options - AOT vs JIT

Just kick started with Angular 2. What are the various Bootstrapping options in angular 2? Why is that when I make a change and refresh the index.html takes little time to retrieve the HTML markups? Differences between them
Aravind
  • 40,391
  • 16
  • 91
  • 110
8
votes
1 answer

Angular2 AOT with Lazy loading Can't resolve [path to lazy module].ngfactory.ts

I am trying to convert an App that was already working with Lazy loaded modules into AOT. I am using the @ngtools/webpack toolkit to compile the AOT code, however I am getting into an error that Angular cant find the Lazy loaded module's code as it…
Joao Garin
  • 573
  • 1
  • 5
  • 16
7
votes
3 answers

issue on angular production build on angular 9 migrate

hello Everyone, i am getting issue on angular after migration, I have migrated the project to angular 9 from angular 8 . the angular with ng server --prod works in version 8 but on version 9 i am getting error . i have checked with ng build…
7
votes
2 answers

Angular condition in type provider with AOT

I have an Angular project which I compile with AOT. I want to be able to register ClassProvider that is resolved dynamically according to configuration. Simplified code I use is this: const isMock = Math.random() > 0.5; @NgModule({ // ... …
Martin Volek
  • 1,079
  • 3
  • 12
  • 27
7
votes
3 answers

Angular AOT: ERROR in ng component html file : Expected 0 arguments, but got 1

Initially i was getting following error while publishing angular .net core SPA App: Can't resolve rxjs/operators in release\directives Which i have resolved by updating the rxjs version to 5.6. Now while publishing the app i am getting following…
S2K
  • 1,185
  • 3
  • 27
  • 55
7
votes
1 answer

Can I emit typing/declaration (.d.ts) and decorator metadata (.metadata.json) files using @ngtools/webpack?

I am working on an Angular library which I am making compatible with AOT compilation. I've got it up and running using some gulp tasks around ngc, but I'd prefer to use @ngtools/webpack since it allows me a more straightforward method to use SASS…
Daniel Schaffer
  • 56,753
  • 31
  • 116
  • 165
7
votes
3 answers

How can I disable AOT in angular2?

I got something like this: ng build --prod --no-aot But I am not able to understand what is the difference between ng build --prod and ng build --prod --no-aot
jesusverma
  • 1,625
  • 1
  • 16
  • 17
7
votes
2 answers

Angular + AOT + Webpack + NgTools - Issue Generating ngFactory

I've been trying to set up AOT with ngTools working in my Angular application (using Webpack for module loading) and having an absolute nightmare of a time of it. I've gone through the various resources in the docs here and here as well as read…
NColey
  • 525
  • 1
  • 6
  • 18
7
votes
2 answers

Angular2 CLI: why bundle size of "--prod" smaller than "--prod --aot"?

I'm using the latest angular-cli (beta-18) for a project. I know the cli is still in very early stages, but I'm perplexed as to why my final bundle size is actually smaller without AoT. When I run ng build --prod, it's 1.08 mb: …
Rob
  • 852
  • 1
  • 9
  • 22
1
2
3
28 29