Skip to main content

Posts

Showing posts from July, 2020

AOT compilation

What is AOT compilation What are the advantages of AOT Every Angular application consists of components and templates which the browser cannot understand. Therefore, all the Angular applications need to be compiled first before running inside the browser.  Angular provides two types of compilation:  JIT(Just-in-Time) compilation AOT(Ahead-of-Time) compilation In JIT compilation, the application compiles inside the browser during runtime.  Whereas in the AOT compilation, the application compiles during the build time.  The advantages of using AOT compilation are:  Since the application compiles before running inside the browser, the browser loads the executable code and renders the application immediately, which leads to  faster rendering . In AOT compilation, the compiler sends the external HTML and CSS files along with the application, eliminating separate AJAX requests for those source files, which leads to  fewer ajax requests . Developers can detect and handle errors during the bui

How does an Angular application work

How does an Angular application work Every Angular app consists of a file named  angular.json . This file will contain all the configurations of the app. While building the app, the builder looks at this file to find the entry point of the application. Following is an image of the angular.json file:  "build" : { "builder" : "@angular-devkit/build-angular:browser" , "options" : { "outputPath" : "dist/angular-starter" , "index" : "src/index.html" , "main" : "src/main.ts" , "polyfills" : "src/polyfills.ts" , "tsConfig" : "tsconfig.app.json" , "aot" : false , "assets" : [ "src/favicon.ico" , "src/assets" ], "styles" : [ "./