Angular 2.0 – what’s ahead of us

AngularJS 2.0 is about to reach beta stage as announced during last week’s AngularConnect conference. But not only the AngularJS Core is evolving. Several supporting projects as well as numerous specialized ones have reached alpha already and will be ready for use in production environments soon. So let’s see what we can expect in the near future:

When will Angular 2.0 be “ready”? Although there are no real promises by the Angular Core team there are good indications that we will not have to wait too long for a first beta. Several Google internal projects are already being migrated to Angular 2.0, including Google’s number one money maker AdWords. Some known issues aside, a main open TODO is documentation. Although there is plenty of material out there on the internet already, Angular’s on-site documentation has been neglected for some time.

The most famous thing about Angular 2.0 is that it is not backwards compatible to Angular 1.x. So before talking about some highlights of Angular 2, let’s have a look about this issue. With ngUpgrade, it will be possible to have mixed Angular 1 and 2 Applications. ngUpdate provides an UpgradeAdapter with which Angular 1 directives can be used within Angular 2 components (upgradeAdapter.upgradeNg1Component('myDirective')) and the other way around (upgradeAdapter.downgradeNg2Component('MyComponent')). So making an existing Application Angular 2 compatible can be done with minimal effort and individual directives/components can be either kept or refactored at some point of time.

Some highlights regarding Angular 2.0:

  • written in TypeScript – so, as the name suggests, we will have typed code and much more, such as annotations
  • not bound to HTML any more – templates can now also be XML, for example
  • performance improvements (new compile step only at the application initialization – after that it is only about re-rendering; view caching; etc…)
  • observables with RxJS
  • no default 2-way data binding for better performance
  • powerful form-controllers

More features are still in an experimental phase, such as Tactical or Template Transforms:

  • Tactical is an approach to allow for the offline use of Angular apps. It does not only offer caching of data for offline access but also optimistic writes which are synchronized with the server as soon as a connection is available again.
  • Template Transforms will allow component developers to bundle some syntactic sugar or entire DSLs with their components. The transform is done during the compile phase after loading the app by manipulating the internal AST (abstract syntax tree).

More news from the TypeScript/Angular stack:

  • angular-cli – for the fast bootstrapping of Angular 2 projects. Allows you to set up a basic project (ng new <name>) and run it on a local server (ng serve) with just two commands.
  • Angular Universal for the server-side rendering of the first view (also helps with SEO)
  • Debugging “reloaded” with Batarangle
  • tight integration of Angular in several cross-plattform SDKs, such as Ionic, Cordova, or NativeScript
  • possibility for full-stack development with TypeScript/Angular for “reactive” apps (e.g. with Meteor)

In conclusion, it is worth the effort getting familiar with Angular 2.0 already, even though it is not production ready yet. There is such a large number of related projects worth a look that you will not get bored in the meantime. 😉

Vorheriger Beitrag
Grails in large projects – Part 3
Nächster Beitrag
Highly available webapps with Java and Spring – Part 1

Related Posts

No results found

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.

Bitte füllen Sie dieses Feld aus
Bitte füllen Sie dieses Feld aus
Bitte gib eine gültige E-Mail-Adresse ein.
Sie müssen den Bedingungen zustimmen, um fortzufahren

Menü