I have been asked to review the book 'Mastering Web Application Development with AngularJS' written by Pawel Kozlowski and Peter Bacon Darwin (published by Packt). The book promises to help people learn AngularJS and understand how to create single-page web applications. The book is extremely beneficial for those who have a working knowledge of HTML, CSS and JavaScript - you can get up and running almost immediately.
One of the greatest things about this book is the fact that it has been reviewed by the AngularJS team, people such as Brad Green, Misko Hevery (aka the Father of AngularJS) and Vojta Jina - all this means that the book is very informative and you can be sure that it contains all the right information.
There are 12 chapters that make up this book broken down into logical sections, while the reader will be exploring how to build an example single page application. The chapters cover the following:
$http
directive as well as the AngularJS promisesAs I had experience working with AngularJS before, some chapters - especially the first 2 - were not really beneficial, however I managed to read about a thing or two that I did not know about. If someone's an absolute beginner, I can see them benefitting from the initial chapters.
For a long time now I have been researching two things about AngularJS, form validation and authentication/authorisation and this book came in very handy as Chapter 5 and 7 cover these items.
Throughout my experience in creating websites and web applications, the most painful but (other than getting some of the regular expressions right) was form validation. AngularJS takes away this pain by some brilliant directives that can be utilised to validate forms on the front-end. Because AngularJS decouples the model from the view, it's very straight forward to add built-in validation. For example, if there's an input field that accepts an email address then, AngularJS automatically checks if the entered string is a valid email address, which in turn means that the model will never contain an invalid e-mail address. These other text-based directives allow the specification of minimum and maximum lengths as well as ngPatterns
that accept regular expressions. This is great to control how complicated a password should be and whether it should contain upper case letters as well as special characters.
The book has a very detailed and methodological overview of forms in AngularJS, including but not limited to bindings, datasources, validation through ng-pristine
, ng-dirty
, ng-valid
and ng-invalid
. I love the explanation on how to show validation errors and how to add various css elements to individual input boxes/fields.
Another great chapter in the book is about authentication/authorisation. It's very important to know that the authentication and authorisation should happen at the server side - the book also points this out. It also discusses the various type of attacks possible in detail - such as cross-site request forgery (XSRF) and man-in-the-middle type of attacks and provides great explanation on how to overcome these using various techniques. Finally, the book also illustrates how to utilise the security service component of AngularJS, detailing how to create a 'security-aware' menu and toolbar - essentially showing/hiding information based on whether there's a valid user object (i.e. if someone is signed in or not.)
My final judgement is that if you're an absolute beginner, this book is a great read, as it gives a very good overview of the various pieces that make up AngularJS. For people who have some experience working with AngularJS, some of the more advanced topics can be useful. It probably could have been better if the example is something more generic, like an online cook-book or a car-dealership. (I know these are all cliche but they don't require further understanding, which is the case with the SCRUM example throughout the book.)