To my Mom and Dad who taught me to love books. It's not possible to thank you adequately for everything you have done for me. To my grandparents for their strong support. To my brother Preetish for being a constant source of inspiration. And to my awesome friends Ipseeta and Fazle for always believing in me.
Preface
AngularJS is an open source JavaScript framework that lets you create amazing AJAX-based web apps. Generally, the complexity involved in building large-scale and complex AJAX apps is tremendous. AngularJS aims to minimize this complexity by offering a great environment for development, as well as the means to test your apps.
As a client-side MVW (Model-View-Whatever) framework, one of the most powerful features of AngularJS is its ability to bring structure to your web apps. Another nice thing about AngularJS is that it extends the HTML vocabulary to make it suitable for building web apps, enabling you to create them declaratively; the resulting code is clean and very readable.
AngularJS ships with many great features out of the box, which you'll use in your day-to-day programming. It supports two-way data binding, nice templating, easy REST interaction, custom component creation, multiple views, routing, and much more. AngularJS also plays well with other libraries and frameworks. For example, you can combine jQuery and AngularJS together to create awesome web applications. AngularJS also demands no commitment. You can include Angular in your web page and use as many features as you like. If you need only the two-way data binding, but no REST interaction, you can employ that feature alone.
AngularJS favors Test Driven Development very much, and features great support for both unit and end-to-end testing. But it also takes debugging very seriously. In 2012, the AngularJS team released a Chrome plugin called Batarang which makes the debugging process a breeze. As a result, the products you develop with AngularJS are very robust and maintainable.
For these reasons (and many more that we'll discuss during the course of this book), AngularJS is one of the top choices when it comes to Single Page App development. You're going to enjoy working with AngularJS!
Who Should Read This Book
This book is suitable for intermediate level web designers and developers. Experience of HTML, CSS, and JavaScript is assumed.
Conventions Used
Youll notice that weve used certain typographic and layout styles throughout this book to signify different types of information. Look out for the following items.
Code Samples
Code in this book will be displayed using a fixed-width font, like so:
A Perfect Summer's Day
It was a lovely day for a walk in the park. The birds were singing and the kids were all back at school.
If the code is to be found in the books code archive, the name of the file will appear at the top of the program listing, like this:
example.css
.footer { background-color: #CCC; border-top: 1px solid #333;}
If only part of the file is displayed, this is indicated by the word excerpt :
example.css (excerpt)
border-top: 1px solid #333;
If additional code is to be inserted into an existing example, the new code will be displayed in bold:
function animate() {
new_variable = "Hello"; }
Also, where existing code is required for context, rather than repeat all it, a will be displayed:
function animate() {
return new_variable; }
Some lines of code are intended to be entered on one line, but weve had to wrap them because of page constraints. A indicates a line break that exists for formatting purposes only, and that should be ignored.
URL.open("http://www.sitepoint.com/responsive-web-design-real-user-testing/?responsive1");
Tips, Notes, and Warnings
Tip: Hey, You!
Tips will give you helpful little pointers.
Note: Ahem, Excuse Me