Why I like Angular 2

Angular JS seems to be one of the leading Front-end frameworks in recent times and the reason is not far-fetched. Recently, we have seen Angular JS make some massive leaps with remarkable improvements in the framework. Angular 4 was just released only recently while we were still trying to figure out what goodies Angular 2 came with. I recently started looking into Angular 2 and I am planning to build my next project using Angular 2. This post is aimed at sharing with you what I like about Angular 2 and why I think it beats its predecessor Angular 1.*.

Angular 2 comes with some really interesting features which will improve Speed, App performance and developer productivity. Bear in mind that this is in no way an exhaustive list of Angular 2 features but only the ones I have discovered and I think are worth sharing.

Angular CLI

This one for me is my most favourite feature. Angular 2 comes with its own CLI which you can install and begin taking advantage of the command line tools.
With the Command line tools, you can start building fast, add components and tests, then instantly deploy. Also, as you modify you angular code, it is continuously being recompiled in the CLI meaning you can see your code changes immediately without refreshing the page. Cool stuff!

Code generation

Angular 2 comes with an inbuilt ability to generate code templates from it’s CLI making it easy to bootstrap your apps with a barebone setup.
Your Angular templates are turned into code that’s highly optimised for today’s JavaScript virtual machines, giving you all the benefits of hand-written code with the productivity of a framework.

Uses Typescript

Now as much as I have not yet explored Typescript in-depth, I believe it is definitely the way to go for Javascript. Typescript has a more cleaner syntax compared to traditional javascript. Typescript is compiled into Javascript at runtime.

Code splitting

Angular 2 splits your code into various parts using components. I think this is a good idea as it helps to separate your app’s components into smaller units which would come in handy during unit testing. Angular 2 apps load quickly with the new Component Router, which delivers automatic code-splitting so users only load code required to render the view they request.

Templates

Angular 2 gives you that power to quickly create UI views with simple and powerful template syntax. All from the CLI. Impressive productivity boost!

Testing

It is best practice to write Unit tests we all know that. But truth is, not every developer would actually include them in their projects. If Unit tests are your thing, with Karma for unit tests, you can know if you’ve broken things every time you save. And Protractor makes your scenario tests run faster and in a stable manner.

Like I mentioned earlier, this is not meant to be an exhaustive list but only a few things that i have discovered as I have been learning Angular 2. If you’d like to know more I suggest you spend some time during the easter break looking at Angular 2. I hope you like it as I do.

Enjoy the easter break!

Share this: