Angular 2+

Angular is a TypeScript-based open-source full-stack web application framework led by the Angular Team at Google and by a community of individuals and corporations. Angular is a complete rewrite from the same team that built AngularJS.

Components, Forms, Services, DI, Directives

Any Type : The any data type is the super type of all types in TypeScript. It denotes a dynamic type. Using the any type is equivalent to opting out of type checking for a variable. Built-in Type : Number, String, Boolean, Void, Null, Undefined User Defined Type : enums, classes, interfaces, arrays and tuples

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. Compiling your application during the build process provides a faster rendering in the browser. Angular offers two ways to compile your application: Just-in-Time (JIT), which compiles your app in the browser at runtime. Ahead-of-Time (AOT), which compiles your app at build time. JIT compilation is the default when you run the ng build (build only) or ng serve (build and serve locally) CLI commands: For AOT compilation, include the --aot option with the ng build or ng serve command: ng build –aot ng serve --aot

  1. Consider AOT compilation.
  2. Consider lazy loading instead of fully bundled app if the app size is more.
  3. your application is bundled and disfeatured.
  4. your application doesn’t have un-necessary import statements.
  5. your application’s 3rd party unused library. If exist and not used, removed from your application.
  6. Remove your application dependencies if not required.

There are some basic guidelines to mitigate the security risks. 1. Consider using AOT compilation. 2. Try to avoid using or injecting dynamic HTML content to your component. 3. Try to avoid using external URLs if not trusted. 4. Try to prevent XSRF attack by restricting the REST APIs.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. For more information - please visit our private policy.