HTML is the primary language of the web since the inception of web technologies.It is also one of the easiest languages to learn.But it has a very specific purpose ,which is to create the static documents for the web.
But software development has come a long way since its inception.From browsers serving static HTML pages , dynamic web applications ,single page applications there have been several milestones in web development technologies.
AngularJS was developed to make applications more interactive for the end user.It was designed to overcome the limitations of HTML.HTML is suitable for creating applications to just display the documents. AngularJS framework also helps in development of single page applications.
AngularJS was developed in 2009 ,but web has changed a lot since then.There are new web standards such as web components and shadow DOM.Angular 2 supports these features.
Lot of things have changed since the first release of AngularJS. Angular 2 is a complete rewrite of AngularJS which addresses these changes in web development.
Angular 2 is a platform for building web and mobile applications.So we can build variety of applications in angular 2 from web applications to mobile applications.
Advantages of Angular JS 2.0
Following are some of the distinguishing features of Angular 2.These advantages of Angular JS 2.0 are introduced considering the changing nature of the web.Web has changed a lot since the initial release of AngularJS. Angular2 is designed considering the current nature of the web.
Applications developed in Angular 2 have wider reach:
Though you could develop mobile applications in AngularJS but there were few challenges which needs to be addressed.When building mobile applications using AngularJS you need to address issues such as:
- Low memory footprint
- Touch support
Angular JS 2.0 is designed with mobile first approach.We can create applications for the web using Angular 2 which will work on different platform such as iOS and windows.
Angular 2 applications can run across different browsers since angular 2 applications are transpiled to ES 5. Transpiling coverts from one version of ES to another.
Since ES 5 is supported in all the browsers so angular 2 applications can run on all the browsers.
Responsive applications for web and mobile
Angular 2 web applications are responsive so that they will work on different devices.
Native applications for ios and android
Native mobile applications are optimized for specific mobile platforms such as iOS and Android.So native mobile applications build with angular are better in terms of performance.
Angular 2 supports server side rendering.Server side rendering improves the speed of page rendering since the rendering happens on the server instead of client.So if the page is being rendered on a mobile device then server side rendering could have significant impact on the page load time.
Server side rendering means that the HTML is generated on the server rather the browser which results in improved application response time.
Server side rendering improves the initial page load time on the server.Also in these scenarios initial page loading could be very slow:
- if there is a slow web service call
- if the rendered html is complicated
Server side rendering is useful in these scenarios.Also server side rendering is better from SEO perspective.
Faster web applications.
Angular 2 is 2.5 times faster than angular 1
There is no digest cycle in angular 2.Digest cycle means that even for a change in single expression all the expressions in our application are re-evaluated.This impacts the performance of the application.Angular 2 has better mechanism for handling such changes ,using change detection mechanism.
Every component in angular 2 has a change detector which re renders the view whenever the component gets changed.
Less learning curve
For learning how to develop application in Angular 2 refer Starting with Angular 2
Angular 2 supports ES 5 and ES 6 compliant languages.This includes Dart and TypeScript. TypeScript is a language which is developed by Microsoft.It has lots of useful features such as compile time type checking , support for decorators.The main advantage of TypeScipt is that you have access to ES 6 and ES 7 features even if the browser doesn’t support it.