Skip to main content
Home  ›  Blog

Welcome Angular 4! And Angular CLI, AOT and Universal!

A big day has arrived - Angular 4 is out, together with the Angular CLI (yes: WebPack, AOT, etc.). So no more Beta, RC or whatever - it's here!

Why Angular 4 after AngularJS 2?

So just a few basics before we start:

  • AngularJS 1 /2 /4 is now just called Angular - this is to standardize documentation language etc. - so no more ...JS - just Angular
  • Angular 2 was a large step from AngularJS 1, so it was explicitly mentioned for a long time. The future Versions of Angular will be much more alligned so the version number will be dropped, especially because there will be a new version every 6 months...
  • ...yes, every 6 months a new main version. Angular is now utilizing a clear, Semantic-Versioning system - so the roadmap is a new main version every half year. 
  • And: Angular 3 was explicitly skipped, because some parts in Angular 2 already had version 3. To get the versions synced, they set everything to 4.

My First Impression

I immediately started creating my first Angular 4 App for DNN - and I was amazed!!!

Compared to the setup in Angular 2 with SystemJS, the new setup using the CLI and  WebPack was a breeze! I had my first DNN/2sxc/Angular4-App running in 15 minutes, and it felt amazing!

You can try my new Hello DNN app here, or just check out the code in the GitHub repo

BTW: Yes, it's super-fast :) 

This is (officially) new in Angular 4

Here are the official highlights of V4

  1. smaller, faster code 
  2. major improvements in AOT (Ahead of Time compilation)
  3. major improvements to Angular Universal (server-side Angular applications)
  4. if/else syntax in templates

+ a few more technical features like FESM or template source-maps. Read more about it in the official release post.

This is IMHO what's important

So in my personal opinion, Angular 4 has a much more important meaning:

  1. The CLI is finally stable, meaning that there is now an official way to develop. This workflow is important, because it means people will work in the same way. 
  2. Now that the CLI is stable, it also means that Angular will now fully adopt WebPack instead of SystemJS as the preferred way of transpiling and bundling. 
  3. Which brings us to AOT - this sounds cryptic, but it's essential when using Angular with DNN. It's the component which will take all your stuff and merge it into a few compressed, optimized, re-usable .js files. 

Basically I believe that now Angular 2+ is finally fit for real DNN projects. With Angular 2 I was very hesitant to start, because much of it felt unfinished. All the code-samples felt like moving targets, because the "best practice" was slippery at best, and kept changing. Now with Angular 4 it finally feels right. So for us (2sic / 2sxc) we will start creating production grade apps right away!

Where are the Tutorials & Docs?

There are still missing - and if you read the official web site, you'll notice that they do start the learning-section with the CLI, but most of the documentation is not updated yet! So basically to get started, best focus on the CLI documentation

When do we get Angular Material?

Basically Angular would work with any CSS including Bootstrap, Foundation etc. but as it's often used for creating applications it really needs a solid application / GUI style framework. And Bootstrap doesn't really work that way. So ATM we're all waiting for Angular Material, and (in my personal opinion) they have just been waiting for 4.0 to become final. My opinion is supported by the fact that they introduced breaking changes to animation related functionality from Angular 2 to 4.

So I believe Angular Material, which is currently Beta 2, should be out within the next 8 weeks. My opinion is supported by the large issue-resolving rate. But it's not official yet, so no promises here.

Shall we start using it?

IMHO Absolutely! I just created my first app in 15 minutes and we'll create our first production apps during the next few weeks and I hope to have some tutorials out ASAP :)

Love from Switzerland,

Daniel Mettler grew up in the jungles of Indonesia and is founder and CEO of 2sic internet solutions in Switzerland and Liechtenstein, an 20-head web specialist with over 800 DNN projects since 1999. He is also chief architect of 2sxc (see github), an open source module for creating attractive content and DNN Apps.

Read more posts by Daniel Mettler