MARGO

News

Do you know the latest AngularJS 2 evolutions?

Jérémy, consultant at Margo, takes stock of the AngularJS 2’s latest evolutions


31/03/2017

AngularJS has become the most popular Javascript framework for web application programming. Launched in 2012, it has already gained in maturity and performance thanks to several evolutions. Today, AngularJS 2 has nothing in common with its first version. That’s why Google decided to make breaking changes to reform and redesign its framework.

Angular is heading for FRP (Functional Reactive Programming)

What is FRP?

The idea behind FRP is to have a reactive application. Technically, it means programming with asynchronous data streams. It’s also programming in a functional way, by using pure functions, avoiding side effects, which remains one of the biggest issues in web application today.

Heading towards FRP, Angular 2 relies on RxJS library. It allows users to manipulate observable data streams thanks to a toolbox full of functional operators. This library leans on the Observer pattern. Its goal is to build a dependence between an observer and an observable, in order to notify the observer each time the observable is modified, so it can update its state.

Angular 2.0 uses TypeScript

TypeScript is a programming language representing a Javascript superset, respecting Esmascript 6 norms. As Angular 2 has a component-based architecture, it is now possible to use classes to isolate the business logic related to a component of our application.

Angular 2.0 has its own CLI

AngularJS 2 uses decorator patterns, strong typing (thanks to TypeScript) and ES6 norms. However, the setup, configuration and maintenance prices for a modern Javascript application using these different tools is high. AngularJS developed its own CLI to overcome this drawback.

In the first Angular version, the change detection process is called dirty-checking. It works with the digest cycle. During each digest cycle, Angular assesses all the recorded watches. If the value sent back by the watch has changed, the match function goes off. The aim is to ensure a consistency in the synchronisation between model and view. However, there was no guarantee to have a parent node checked before its child.  

With Angular 2, the mechanism is simplified. A change does not spread in a unidirectional way, from the root. In other words, during a modification on the model, the parent component is always checked before its children.

How to migrate from Angular 1.x to Angular 2?

For a weighty application, a total migration is not possible. In that case, you should use ng-upgrade. The idea is that Angular 2 and Angular 1 coexist in the same application. Thanks to this approach, it is possible to upgrade components from Angular 1.x to Angular 2, but also to downgrade components from Angular 2 to make them work with Angular 1.x. Thus, you can progressively migrate. The perfect applicants to start a migration to Angular 2 are services with no dependencies. Then you can tackle leaf components, before converting root components.


Angular
Google
High Performance IT
News

Introduction to TensorFlow on the datalab of Google Cloud Platform

TensorFlow is a software library, open source since 2015, of numerical computation developed by Google. The particularity of TensorFlow is its use of data flow graphs.

30/05/2018 Discover 
News

Cookies, very used, but so little understood

Margo Consultants participated in Devoxx France 2018 , the conference for Passionate Developers organized from April 18 to 20, 2018 in Paris. Discover below a first report dedicated to the conference on HTTP cookies that was hosted on Thursday, April 19 by Hubert Sablonnière .

18/05/2018 Discover 
News

Sparkube: when OLAP becomes child's play

You finally have your favourite notebook, your Spark cluster is well configured and powerful, and your HDFS contains everything you need in data. And yet, do you know that you can boost the added value of your data, thanks to the power of OLAP? At the Devoxx France 2018 conference, Antoine Chambille, R & D Director at Activeviam , came to present the Sparkube project that has just been launched.

16/05/2018 Discover 
News

Modern Android Development: the new contributions of the Java language

Since the release of Android 1.0 in 2008, the Android ecosystem has evolved enormously, but especially in recent years, with the new contributions of the Java language, changes related to terminals and the appearance of new tools. Recommendations and good practices have evolved accordingly.

15/05/2018 Discover 
News

Introduction to Reactive Systems

Margo Consultants participated in  Devoxx France 2018 , the conference for Passionate Developers, organized from April 18 to 20, 2018 in Paris. Discover a synthesis on reactive systems illustrated by a concrete use case.

11/05/2018 Discover 
News

Digital Women Day #ForABetterWorld

On Tuesday, April 17th 2018, the Margo HR team attended the French Digital Women Day (Journée de la Femme Digitale), thought up by Delphine Remy-Boutang. It was a great opportunity to meet inspiring, bold, innovative and creative women. On the agenda: CEOs, Senior Officials, intra and entrepreneurs, Heads of Communication, General Managers, Secretaries of State. Many profiles with various careers and one common goal: innovation for all and by all.

07/05/2018 Discover