Angular 2

Hello everyone, this is Nebil from NetDevices !

Today I am going to talk aboutAngular 2. It's already been a year since we've been at version 1.0, considering that the very first version of Angular was released in 2009.

Introduction to Angular and Angular 2

Angular is a Framework ("framework of function") Front end in open source. Unlike the back end which will require a database, the front end will be more related to the design, to the interface of the platform.

What's the main purpose of Angular?

If we were to make an allegory of the human body, the structure of a website could be defined as follows:

  • the skeleton that could match the code HTML
  • the "dressing up", the design that would be possible thanks to the CSS
  • the "action", the interactions with the interface, which would be rather related to language Javascript

UX will obviously depend on these factors. One of the main objectives of Angular will be to improve the interaction between Javascript and HTML

Why switch to Angular 2?

For a few years now we have been witnessing an accelerated mutation of the internet and connected objects. Indeed, the internet is now "cross device" (smartphones, tablets, computers...). In addition, we no longer use browsers in the same way. We are constantly developing new functions and extensions to expand the possibilities. However, this has an impact: the slowing down of the browser. Angular 1 was originally too "tied" to the browser and therefore not powerful enough for the use we have of the internet on mobile devices for example. 

When Google engineers designed Angular 2, they looked to the future. They imagined that we would be more mobile. It would therefore have to be cross-platform, minimising the attachment to the browser, which implies that we would no longer be so constrained to follow the browser's updates. This detail will allow more speed.

There is a real contrast between Angular 1 and 2, if only for learning. Angular 2 is of course more complex. This complexity is due to the fact that The use of this tool also requires knowledge of Typescript and Rxjs (Reactive Extensions). Typescript allows the use of new technologies in Javascript. It will have a role of intermediary by making the new technologies compatible with the old ones, which makes it possible not to undergo the constraint of the updates. Rx will take care of the data management.

Angular 2 and React

There is a real debate between Angular 2 designed by Google and React of facebook in terms of performance. 

React offers a version "Virtual DOM"and Angular2 another version".Shadow DOM” . However, they both aim to limit the device's dependence on the DOM through partial or even total abstraction from it.

The virtual DOM will correspond to a virtual copy of the DOM, considered to be much lighter than the latter. However, when the DOM is modified, the developer must update it regularly.

In comparison, Angular 2 will rely on the "shadow DOM" which consists of a partial abstraction of the DOM. This means that direct modifications to the DOM are made, which avoids the need to constantly monitor for updates. This is made even easier by Typescript.

The value of abstaining from the DOM

In simple terms, the DOM (Document Object Model) is an API (Application Programming Interface) that allows the development, management and proper use of documents in HTML and XML.

The DOM was originally designed for computer browsers. This implies (as soon as you change device) a limit to the amount of data stored, and therefore a considerable impact on speed and performance. An abstraction of the DOM will reverse this trend and make application programming much simpler on the one hand, and an improvement of theUX/UI.

Although we use both technologies at NetDevices, I chose to specialise in Angular 2 because I use Meteor.js. This allows me to make fullstack in real time.

Angular 2 at NetDevices

We regularly use Angular 2 at NetDevices when building web and mobile applications. We are also using it on projects for two of our clients, consisting of creating a back office and a application mobile allowing them to broadcast radio and advertisements in their shops. For these projects, we are combining Angular 2 à Cordova and Ionic2.

NetDevices is a team of methodical project managers, geeky developers, integrators / web designers, all passionate about web development and new technologies.With our Web2Mobile, Sharry (mobile market place) solutions, and our partnership with IBM, we know how to meet your needs from the simplest to the most complex.For more information, do not hesitate to contact us!