Category Archives: Angular

[EN] How to upgrade Angular 2 project to Angular 4

About a month ago Angular 4 has been released. You may want to ask what about version 3? Well, there’s no Angular 3. We have Angular 4, but I have started to learn Angular 2 and now what? Should I start to learn Angular 4 and forget about version 2? The answer is no. The newest version is backwards compatible with 2.x.x version. It’s just an evolution rather than revolution.

What’s new?
– applications are smaller and faster – the size of the generated code was reduced by around 60 %
– improved *ngIf and *ngFor
– angular universal – project that allows devs to run Angular on a server
– TypeScript 2.1 and 2.2 compatibility
– source maps for templates – when there is an error in a template, source maps are generated
More will come soon with v 4.1.

If Angular 4 has been released, why not to use it in our new project? Let’s see if it is easy to upgrade Angular 2 project to Angular 4.
Open command line tool, go to app folder and type commands as below, then wait a little.

1

After this we can check version of angular in our app by command

As you see here it is, Hello Angular 4.0.3 🙂

2

So far it’s good, we will see for some time how it works 😉