Macadamian Blog

Learn Angular 4: A Review of ng-book 2

Andrej Vasilj

Having a one-stop shop for everything Angular may not entirely replace piecing together tidbits from individual web tutorials and StackOverflow answers, but ng-book 2 will certainly be a very robust addition.

learn angular 4 a review of ng-book 2

At Macadamian Technologies we’ve been all-in when it comes to web development with Angular for years now thus the natural evolution for us is Angular4. As part of our ongoing material and practical training, we’ve come across Ng-book 2: The complete book on AngularJS 4. What follows here is a short review with a few notable highlights.

SEE ALSO: JavaScript Promises Explained

Popularity contests aside, it is fairly clear that Angular4 will likely maintain its place among the top three web frameworks for the foreseeable future not only because it is the brainchild of Google Inc., but more importantly because it is at the forefront of modern web design. The completeness of the framework itself, along with its incorporation of several major third-party libraries including TypeScript and RxJS makes for a powerful combination. While being heavily opinionated may take away from the flexibility of always using the most cutting-edge web libraries, it can certainly decrease development time while increasing out-of-the-box feature richness. With the Angular-cli tool, you’re now one simple “ng new my-app-name” call away from a fully operational Angular4 skeleton project including a minimalistic web server. With that said, it can most definitely be a daunting task to jump into Angular4 development for programmers of any skill level, even those with Angular1 (now known as AngularJS) experience.

Based on the massive size of Ng-book 2 at almost 700 pages, you may initially feel like you’re looking up from the bottom of a skyscraper and you’ll also probably be thinking “there’s no way Angular4 contains this much stuff, does it?”. Luckily enough, the nature of this book makes for a smooth and fast read. The bulk is due to the fact that it caters particularly well to complete beginners and thus explains every little detail and every line of code with clarity. If you’re already familiar with Angular’s own tutorial, the “Tour of Heroes”, you can think of Ng-book 2 as the ultra-expanded version.

The book starts off with an introduction to components which are essentially the heart of an Angular4 application. You’ll get your feet wet with basic concepts such as displaying variables within a template, passing inputs and subscribing to outputs. Before exploring more advanced features of the framework, you’ll get a crash course on using TypeScript. This is a most-welcomed inclusion considering that the majority of Angular4 newcomers, myself included, will also likely be new to TypeScript as well.

As usual, when it comes to programming books, each chapter of Ng-book 2 will focus on a concrete example application and work through all new concepts by showcasing their specific use within the example. Most of the provided examples are quite relevant in the real world and you’ll be able to find immediate connections with your own personal or professional projects. These include things like building itemized shopping apps and music searching apps. There are however some strange outliers such as the chat forum example within the Redux section. Calculating the total number of unread messages in a thread certainly belongs to the server-side/database logic and not in the front-end thus resulting in a somewhat contrived example. This, along with the addition of Underscore.js functions makes this a fairly dense section to work through. At the end, even though understanding the content, I was left wondering what kind of specific situations it would make sense to wade through the additional boilerplate to reap the benefits of its promised state management solution. Despite all of this, I must mention that the inclusion of an Angular4-specific guide to Redux as well as both a third-party library agnostic and inclusive walk-through adds a lot of value.

Throughout the book, I enjoyed several “Oh that makes sense now!” moments especially in relation to the cryptic nature of Angular templates. For example, you may have already noticed that some template directives are surrounded by parentheses, others by brackets and some even by both together. This book pointed out the now obvious pattern that brackets always signify inputs, parentheses outputs, and the combination two-way bindings, or in other words, simultaneous input and output.

Overall, this book will be your fully comprehensive guide and ongoing reference to angular syntax and best practices. Having a one-stop shop for everything Angular may not entirely replace piecing together tidbits from individual web tutorials and StackOverflow answers, but it will certainly be a very robust addition.

Insights delivered to your inbox

Subscribe to the dev blog to get the latest insights in IoT, Alexa Skills development, and software development.