Introduction

AngularJS is a JavaScript framework that helps you create modern client-side web applications. Through its elegant conventions, AngularJS provides solutions to common problems and save you a large amount of code that you would otherwise have to write. With AngularJS you can focus on the actual task, instead.

This book introduces you to AngularJS through a sample project that builds gradually. You will learn about the basic concepts, which allow you to create structured, modular and thus easy-to-maintain applications. In particular, we explain concepts such as modules, scopes, services and directives, and show how you can use them effectively. A separate chapter is devoted to connecting to a REST-based web service. In addition, we discuss tools such as Bower, Grunt, Karma and Yo. These tools can save you time by rendering certain tasks unnecessary. With Yeoman we outline a workflow that defines how these tools can be employed to create a productive environment for developers.

During the preparation of this book, we have a large number of projects implemented using AngularJS. Many of the insights from these practical experiences are included in this book.

After reading this book you should be able to

  • understand how you can use each of the modules in AngularJS and how they interact,
  • develop modular, structured and easy-to-maintain client-side web applications,
  • create quality AngularJS applications through the use of the test-driven development method.

Who This Book Is For

This book is primarily aimed at web developers with experience with JavaScript and have acquired a basic understanding of the language, and who now wish to take their knowledge to the next level through the use of the test-driven development method and techniques for JavaScript code structuring and modularization. Moreover, it will help if you have experience with jQuery. Such skills are not required, but will help you appreciate how a framework like AngularJS plays a role in JavaScript application development.

Prerequisites

You do not need any prior knowledge of AngularJS to understand the content of this book. However, you need a basic understanding of JavaScript. In addition, you should also know both HTML and CSS basics. It would also be advantageous if you had learned the basic concepts of test-driven development.

Who This Book Is Not For

As experience in web environment and specially in JavaScript is required, any developer who has no experience in this area is advised to first work out the basics required before reading. Furthermore, you should not consider it a reference in which you will find all the answers to the AngularJS framework questions. It does not discuss all the features and directives of AngularJS. Instead, it explains and demonstrates the main features and concepts of the framework using small practical examples.

About This Book

The book begins with a quick start in Chapter 1, “AngularJS Quick Start” to explain the framework by presenting some of the core concepts of AngularJS in short examples. This chapter demonstrates the potentials and added value of AngularJS. You should get a sense of why AngularJS is worth using. However, we will not explain the examples in detail. You should read this chapter if you want to quickly produce impressive results and experiment a bit.

Then, it goes further with the basics and concepts of the framework in Chapter 2, “Basic Principles and Concepts.” This chapter first explains a few key concepts of AngularJS, including the Model-View-ViewModel pattern (MVVM), two-way data binding, dependency injection and testability. It also presents the individual application modules that AngularJS ships with and with which you can write applications.

Having explained the basics, the book continues with the development of an example project called BookMonkey in Chapter 3, “The BookMonkey Project.” This is the main part of the book and it shows how you can create a small web application to browse a book collection using AngularJS . This example demonstrates how the basic concepts and features of AngularJS are used in a real-world application. Therefore, we have made sure that we follow the test-driven development approach when developing this application. In Chapter 4, “Extending the Application” we extend the project to include an admin section and custom directives and explain how to consume a REST web service.

In Chapter 5, “Project Management and Automation” and Chapter 6, “Debugging” we discuss project-related issues such as project management, task automation, debugging and automated tests. In Chapter 7, “Frequently Asked Questions” we answer some of the questions that people asked us many times within a project.

For a complete beginner to AngularJS, it makes sense to first read Chapter 1, “AngularJS Quick Start” and Chapter 2, “Basic Principles and Concepts” to learn the vocabulary of the framework. Building on this knowledge, the practical example in Chapter 3, “The BookMonkey Project” and Chapter 4, “Extending the Project” can be easily updated. Chapters 5, 6 and 7 can be read independently of the previous chapters to prepare for an upcoming project or to familiarize yourself with the tools used in the project.

Downloading Examples and Getting An Update

The examples in this book are available from the publisher’s website at

http://books.brainysoftware.com

These examples were developed with AngularJS version 1.2.10. This version reflects the most current version at the time of writing. However, we will be updating the examples accordingly if there are incompatibilities with future versions of AngularJS.

Contacting the Authors

Since 2013 the authors have been running the portal AngularJS.DE2 (http://angularjs.de). This portal regularly publishes articles on the current issues about AngularJS, and AngularJS developers can network and offer their service. If you need consultants or training for your development team, you can contact the authors directly.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.219.4.174