What's new in Angular 2

Angular 2

What is Angular?
  • Angular is a framework for dynamic web applications.
  • It provides a way to organize HTML, JavaScript, and CSS to keep your front-end code clean.
Note: You don’t need any prior experience with Angular 1, In fact if you don’t know Angular 1. It will less confusing. 

What you need to know before jumping into Angular 2?
  • Basic JavaScript.
  • Basic HTML & CSS.
  • JavaScript: ES2015(optional).
What is the difference between Angular 1 and 2?
  • Speed- Angular 2 is faster.
  • Components- instead of controller and scope, we use components, which feel simpler.
  • Simpler Directives – Creating custom directives is much simpler.
  • Intuitive Data Binding – When we need to link data to an HTML element or listen for a button clicking on the page, we have an intuitive syntax.
  • Services are now just a class.
  • Many more small improvements.
  • It has more choice for languages.
  • Angular 1.x is easy to setup. Where AngularJS 2 is dependent of other libraries and it requires some efforts to set up it.
What language to use with Angular 2?

We could have gone with JavaScript but all browsers don’t support the newest version of JavaScript.

There are ways to access these features:


TypeScript: Our Language of Choice:

Typescript is Microsoft’s extension of JavaScript that allows the use of all
ES2015 features and adds powerful type checking and object-oriented features.

Transpiling Locations:

Our browsers don’t know how to read Typescript out of the box, so we have two options when it comes to changing our Typescript code into JavaScript.
  • Transpile to JS in the browser.
  • Transpile to JS before shipping to browser (This method is faster)

Comments

Popular posts from this blog

Setting up a project in Angular 2