What is AOT Compilation in Angularjs 2

September 13, 2017 superadmin 0

AOT (Ahead of Time compilation) is used to compiles the angular components and templates to native JavaScript and HTML during the build time instead of run-time. The compiled HTML and JavaScript are deployed to the web server so that the compilation and render time can be saved by the browser. So It is the biggest advantage of AOT to improve the performance of applications. Advantages: Smaller Angular framework download size:  The Angular 2 app is already compiled so it is faster. Faster Rendering: The browser downloads a pre-compiled version of the application. So the browser loads already executable code and [...]

Advantages of angularjs 2 over angular 1

September 13, 2017 superadmin 0

The main differences and advantages on Angular2 vs. Angular 1 as following: It is entirely component based: The earlier version of Angular had a focus of Controllers but now has changed the focus to having components over controllers. Angular 1: var app = angular.module(“userApp”, []); app.controller(“userController”, function($scope) { $scope.users = [{ name: "sathish", Age:30}, { name: "ram", Age:33}]; }); Angular 2: Here the @Component annotation is used to add the metadata to the class. import { Component } from ‘angular2/core’; @Component({ selector: ‘usersdata’, template: ‘<h3>{{users.name}}</h3gt;’ }) export class UsersComponent { users = [{ name: “sathish”, Age:30}, { name: “ram”, Age:33 [...]