Skip to main content
main-content
Top

About this book

Angular 5 updates for this book are now available. Follow the Download source code link for this book on the Apress website.

Get the most from Angular 2, the leading framework for building dynamic JavaScript applications. Best-selling author Adam Freeman begins by describing the MVC pattern and the benefits it can offer and then shows you how to use Angular in your projects, starting from the nuts-and-bolts and building up to the most advanced and sophisticated features, going in-depth to give you the knowledge you need.

Each topic is covered clearly and concisely and is packed with the details you need to learn to be truly effective. The most important features are given a no-nonsense in-depth treatment and chapters include common problems and details of how to avoid them.

What you’ll learnGain a solid architectural understanding of the MVC PatternLearn how to create rich and dynamic web app clients using Angular 2Learn how to extend and customize Angular 2Learn how to test your Angular 2 projects

Who this book is for

Web developers with a foundation knowledge of HTML and JavaScript who want to create rich client-side applications.

Table of Contents

Chapter 1. Getting Ready

Abstract
Angular taps into some of the best aspects of server-side development and uses them to enhance HTML in the browser, creating a foundation that makes building rich applications simpler and easier. Angular applications are built around a design pattern called Model-View-Controller (MVC), which places an emphasis on creating applications that are
Adam Freeman

Chapter 3. Putting Angular in Context

Abstract
In this chapter, I put Angular in context within the world of web app development and set the foundation for the chapters that follow. The goal of Angular is to bring the tools and capabilities that have been available only for server-side development to the web client and, in doing so, make it easier to develop, test, and maintain rich and complex web applications.
Adam Freeman

Chapter 6. JavaScript and TypeScript: Part 2

Abstract
In this chapter, I describe some of the more advanced JavaScript features that are useful for Angular development. I explain how JavaScript deals with objects, including support for classes, and I explain how JavaScript functionality is packaged into JavaScript modules. I also introduce some of the features that TypeScript provides that are not part of the JavaScript specification and that I rely on for some of the examples later in the book. Table 6-1 summarizes the chapter.
Adam Freeman

Chapter 8. SportsStore: Orders and Checkout

Abstract
In this chapter, I continue adding features to the SportsStore application that I created in Chapter 7. I add support for a shopping cart and a checkout process and replace the dummy data with the data from the RESTful web service.
Adam Freeman

Chapter 10. SportsStore: Deployment

Abstract
In this chapter, I prepare the SportsStore application for deployment by incorporating all of the application content and the Angular framework into a single file and “containerizing” the application using Docker.
Adam Freeman

Chapter 13. Using the Built-In in Directives

Abstract
In this chapter, I describe the built-in directives that are responsible for some of the most commonly required functionality for creating web applications: selectively including content, choosing between different fragments of content, and repeating content. I also describe some limitations that Angular puts on the expressions that are used for one-way data bindings and the directives that provide them. Table 13-1 puts the built-in template directives in context.
Adam Freeman

Chapter 15. Creating Attribute Directives

Abstract
Throughout these chapters, I describe how custom directives work by re-creating the features provided by some of the built-in directives. This isn’t something you would typically do in a real project, but it provides a useful baseline against which the process can be explained. Table 15-1 puts attribute directives into context.
Adam Freeman

Chapter 17. Understanding Components

Abstract
Components are directives that have their own templates, rather than relying on content provided from elsewhere. Components have access to all the directive features described in earlier chapters and still have a host element, can still define input and output properties, and so on. But they also define their own content.
Adam Freeman

Chapter 20. Using Service Providers

Abstract
In the previous chapter, I introduced services and explained how they are distributed using dependency injection. When using dependency injection, the objects that are used to resolve dependencies are created by service providers, known more commonly as providers. In this chapter, I explain how providers work, describe the different types of provider that are available, and demonstrate how providers can be created in different parts of the application to change the way that services behave. Table 20-1 puts providers in context.
Adam Freeman

Chapter 22. Creating the Example Project

Abstract
Throughout the chapters in the previous part of the book, I added classes and content to the example project to demonstrate different Angular features and then, in Chapter 21 introduced feature modules to add some structure to the project. The result is a project with a lot of redundant and unused functionality, and for this part of the book, I am going to start a new project that takes some of the core features from earlier chapters and provides a clean foundation on which to build in the chapters that follow.
Adam Freeman

Chapter 24. Making Asynchronous HTTP Requests

Abstract
HTTP Requests Ajax Web services All the examples since Chapter 11 have relied on static data that has been hardwired into the application. In this chapter, I demonstrate how to use asynchronous HTTP requests, often called Ajax requests, to interact with a web service to get real data into an application.
Adam Freeman

Chapter 27. Routing and Navigation: Part 3

Abstract
In this chapter, I continue to describe the Angular URL routing system, focusing on the most advanced features. I explain how to control route activation, how to load feature modules dynamically, and how to use multiple outlet elements in a template.
Adam Freeman

Chapter 29. Angular Unit Testing

Abstract
Unit testing In this chapter, I describe the tools that Angular provides for unit testing components and directives. Some Angular building blocks, such as pipes and services, can be readily tested in isolation using the basic testing tools that I set up at the start of the chapter.
Adam Freeman
Additional information