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

Aot errors angular 2 different behaviour

I'm building my angular 2 project with angular-cli. Locally I build it with no problem for prod ng build --prod --aot. When it is build on the server however the following errors are present: ... [1m [31mERROR…
user3719857
  • 1,083
  • 4
  • 16
  • 45
0
votes
1 answer

Unable to use HTML form validators for Angular AoT - "property 'required does not exist"

I'm attempting to build an Angular 2 project, using angular-cli with the --prod and --aot arguments. The build is failing with the following error: Property 'required' does not exist on type '{ [key: string]: any; }'. In my HTML, I'm using HTML…
0
votes
0 answers

Angular 2 AOT: Getting lot of errors in index.d.ts

I have an angular application currently configured with JIT, and it's working fine. I tried configuring it to work with AOT (Ahead of time) compilation. Here's my work till now: Here is my tsconfig-aot.ts: { "compileOnSave": true, …
Kush Grover
  • 363
  • 1
  • 6
  • 16
0
votes
1 answer

Why would Webpack 2 Ahead-Of-Time compilation not include the Map class?

I've been converting a Webpack 1 application to version 2, mostly for the benefits of AOT compilation and tree-shaking. At present, the code compiles - but when I test it, the application crashes out because the Map class and its constructor can't…
Grizzled
  • 101
0
votes
0 answers

angular cli errors after updating to @angular/cli 1.0.0 rc1

I am getting below errors similar to below after updating to most recent version of angular cli ERROR in Error encountered resolving symbol values statically. Function calls are not supported. Consider replacing the function or lambda with a…
Yousuf
  • 3,105
  • 7
  • 28
  • 38
0
votes
1 answer

Error: Can't resolve all parameters for Directive

I'm facing a problem trying to create a directive npm package. I had already created packages for @Component but this is the first I create for @Directive. The problem I'm facing is that when I run ng serve the build completes ok but when I load the…
Bruno João
  • 5,105
  • 2
  • 21
  • 26
0
votes
1 answer

Is it possible to dynamically load an html template with angular components to a angular app which is AOT compiled?

In my angular application, back-end users can create custom templates. Those custom templates need to be loaded in the angular application at specific positions. I have a custom directive which gets templates ( based on the routes) from the CMS and…
Amit
  • 53
  • 7
0
votes
1 answer

Angular2 AOT ngtools/webpack failed on linux

My project is building on Linux and I've no idea why. The distribution is Red Hat Enterprise Linux Server release 7.0. My environment is: "node" : "6.9.1" "@angular/compiler-cli": "2.4.7", "@ngtools/webpack": "1.2.11", "typescript":…
bevrard
  • 119
  • 7
0
votes
0 answers

angular2 AOT build failed, can't resolve module @angular/core/src/di/opaque_token from undefined

I am using "@angular/common": "2.3.0", "@angular/compiler": "2.3.0", "@angular/compiler-cli": "2.3.0", "typescript": "2.0.3", "webpack": "1.13.0", When i am running node_modules/.bin/ngc -p tsconfig-aot.json I got this error: can't…
user3006967
  • 3,291
  • 10
  • 47
  • 72
0
votes
1 answer

AOT error: require is not defined (caused by ng2-dragula library)

I have an angular 2 application and am using ng2-dragula library. Everything is working in development (JIT compilation) mode. When I compile with AOT, the aot build and rollup are successful, but then I get this error in the browser: Uncaught…
Kevin Quiring
  • 639
  • 1
  • 11
  • 26
0
votes
0 answers

webpack get svn folder in the build directory

I'm building an Angular2 application. When I use the ng-tools/webpack loader, in the final build I get some svn folders in the dist repository. How could I avoid the creation of svn folders? Here is my webpack.js: /** * Webpack…
bevrard
  • 119
  • 7
0
votes
2 answers

Dynamic angular 2 expressions bind to view

I am fetching part of the page from some service. How can I achieve that angular expression or router staff working as dynamic content? Controller.ts variable = 'some text'; dynamicContent =' {{variable}} Or
user2771738
  • 913
  • 11
  • 31
0
votes
1 answer

routerLink not working with AOT build

The routerLink works fine when I do a normal JIT build. But when I try to do an AOT build router link does not redirect to the specified route. My html code
0
votes
1 answer

ngc not compiling project using not typed third party libraries

The project uses a third party library with no types defined. As the project is developed using Angular CLI (version 1.0.0-beta.29), the library is declared in typings.d.ts. In my case: declare module ‘xml2js-es6-promise’; Project compiles and is…
Lupe
  • 232
  • 1
  • 12
0
votes
0 answers

How to Implement AOT in Angular 2 using Webpack 2?

In my sample Angular 2 SPA , I have used Webpack 2 module bundler in order Bundle all my js files Implement "Tree Shaking" to remove dead code and reduce bundle js file size and to implement Ahead-of-time compilation to reduce the bundle js file…
refactor
  • 13,954
  • 24
  • 68
  • 103