What is Angular JS2 ?
Angular JS2 is a modern framework for app development. It is essentially a structure that helps you create applications faster by providing a number of service and objects that makes things easier for app developers.
The Angular JS2 is a dramatic upgrade to the previous version of the framework. It is really a rethinking of how applications should be built.
One of the primary reasons for a lot of these changes is performance. So Angular JS2 apps run 3-5 times faster than the previous version.
- Framework for app development;
- Dramatic upgrade from Angular JS1;
- Much faster performance;
How is Angular JS2 different than the original version?
Firstly, in the new version of Angular JS, everything revolves around something called component. Components are like Angular JS1's custom directives. They let you create functionality around custom tags. So, instead of adding an
ngApp directive to a section of code, you simply invert your own tags and then program the functionality for these tags yourself. It is a lot like using web components and it is one of the best new features of the framework. The components are also much simple than Angular JS1's custom directives.
Secondly, since most of the work is handled by components, there's really no need for controllers in Angular JS2.
Thirdly, one of the big adjustments you will have to make is that there is no more scope in Angular JS2, the templating system is also richer, which also means more powerful, but more complex.
- Focus on components;
- No more controllers;
- No more scope;
Now you can program Angular JS in a variety of different languages. This is one of the ways that Angular JS2 is significantly different since you can choose one of these three languages:
- Dart - a open source language from Google.
Advantage of using TypeScript
Angular JS2 was actually built with TypeScript, so there is a significant advantage to learning how to work with TypeScript. In addition, mainly that most of the documentation that you'll find for Angular JS2 will be written in TypeScript too.
ES6 also has a rich templating system that is extensively used in Angular JS2 and it makes creating templates a lot easier and much more fun than in Angular JS1. TypeScript also adds 2 important features to Angular JS2.
- The first is types which allows you to define the types of variable that you're using. Now this is optional, but it's something that can help with debugging so it's going to be a good idea.
- ES6: classes;
- ES6: templates;
- TypeScript: types;
- TypeScript: annotations;
References & Resources
- Dependency injection
- Directives and Pipes
- Data binding
- HTTP Get vs. Post
- Node.js is everywhere
- MongoDB root user
- Prefer Async Script Loading
- Components, Bootstrap and DOM
- What is HEAD in git?
- Show the changes in Git.
- What is AngularJS 2?
- Confidence Interval for a Population Mean
- Accuracy vs. Precision
- Sampling Distribution
- Working with the Normal Distribution
- Standardized score - Z score
- Evaluating the Normal Distribution
- What is Nodejs? Advantages and disadvantage?
- How do I debug Nodejs applications?
- Sync directory search using fs.readdirSync