Thursday 8 March 2018

Angular 4 Compiler

Angular compilation

Angular offers two ways to compile your application:

Ahead-of-Time (AOT)-  which compiles your app at build time.
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.

Just-in-Time (JIT)-  which compiles your app in the browser at runtime
JIT compilation is the default when you run the build-only or the build-and-serve-locally CLI commands:

ng build ng serve

For AOT compilation, append the --aot flags to the build-only or the build-and-serve-locally CLI commands:

ng build --aot ng serve --aot

The --prod meta-flag compiles with AOT by default.                                                          

Until Angular 8, the default compilation mode was JIT, but from angular 9, the default compilation is AOT. When we do ng serve, it depends on the value of aot passed in the angular.json file.

1 comment:

  1. Hello Mate,


    Nice to be visiting your blog again, it has been months for me. Well this article that i’ve been waited for so long.

    I’m working on
    Angular2-Meteor, When i use routing inside the meteor account methods data binding is not working for the next route. But when i reload the page using refresh button data binding is working fine.
    Below is the code on the client side:
    Meteor.loginWithPassword({email:this.usernameCtrl.value},this.passwordCtrl.value,(error,result)=> {
    if(error) {
    console.log(error);
    } else {
    this.router.navigate([‘Dashboard’]);
    }
    });
    Awesome! Thanks for putting this all in one place. Very useful!


    Many Thanks,
    Morgan

    ReplyDelete

Topics

ADFS (1) ADO .Net (1) Ajax (1) Angular (43) Angular Js (15) ASP .Net (14) Authentication (4) Azure (3) Breeze.js (1) C# (47) CD (1) CI (2) CloudComputing (2) Coding (7) CQRS (1) CSS (2) Design_Pattern (6) DevOps (4) DI (3) Dotnet (8) DotnetCore (16) Entity Framework (2) ExpressJS (4) Html (4) IIS (1) Javascript (17) Jquery (8) Lamda (3) Linq (11) microservice (3) Mongodb (1) MVC (46) NodeJS (8) React (11) SDLC (1) Sql Server (32) SSIS (3) SSO (1) TypeScript (1) UI (1) UnitTest (1) WCF (14) Web Api (15) Web Service (1) XMl (1)

Dotnet Guru Archives