Learning Angular 2

Your quick, no-nonsense guide to building real-world apps with Angular 2

Learning Angular 2

This ebook is included in a Mapt subscription
Pablo Deeleman

21 customer reviews
Your quick, no-nonsense guide to building real-world apps with Angular 2
$31.99
$39.99
RRP $31.99
RRP $39.99
eBook
Print + eBook
Subscribe and access every Packt eBook & Video.
 
  • 4,000+ eBooks & Videos
  • 40+ New titles a month
  • 1 Free eBook/Video to keep every month
Start Free Trial
 
Preview in Mapt

Book Details

ISBN 139781785882074
Paperback352 pages

Book Description

Angular 2 was conceived as a complete rewrite in order to fulfill the expectations of modern developers who demand blazing fast performance and responsiveness from their web applications.

This book will help you learn the basics of how to design and build Angular 2 components right from the beginning, providing full coverage of the TypeScript syntax required to follow the examples included. From that point on, we will build upon our first components, interconnect them, and give shape to larger web applications. We will then move to implementing routing in Angular 2, analyzing how to handle application states, and navigating from one component to another in depth. After this, the book features full coverage of web forms and user input validation, later leveraging all of this information to go through the basics of implementing user authentication in Angular 2 and providing a bird’s eye view of the different strategies at hand to secure pages and areas of your website. Animating components and DOM elements with Angular 2 is also covered in this book. The final part of this book provides broad insights into how to unit test components and other modules such as services, directives, routes or pipes.

Table of Contents

Chapter 1: Creating Our Very First Component in Angular 2
A fresh start
Setting up our workspace
Hello, Angular 2!
Enhancing our IDE
Diving deeper into Angular 2 components
Summary
Chapter 2: Introducing TypeScript
Understanding the case for TypeScript
Types in TypeScript
Functions, lambdas, and execution flow
Classes, interfaces, and class inheritance
Decorators in TypeScript
Organizing our applications with modules
The road ahead
Summary
Chapter 3: Implementing Properties and Events in Our Components
A better template syntax
Configuring our template from our component class
Summary
Chapter 4: Enhancing Our Components with Pipes and Directives
Directives in Angular 2
Manipulating template bindings with Pipes
Putting it all together in the Pomodoro task list
Building our own custom pipes
Building our own custom directives
A word about naming conventions for custom directives and pipes
Summary
Chapter 5: Building an Application with Angular 2 Components
Introducing the component tree
Common conventions for scalable applications
How dependency injection works in Angular 2
Introducing the Pomodoro App directory structure
Refactoring our application the Angular 2 way
Summary
Chapter 6: Asynchronous Data Services with Angular 2
Strategies for handling asynchronous information
Reactive functional programming in Angular 2
Introducing the HTTP API
A real case study – serving Observable data through HTTP
Summary
Chapter 7: Routing in Angular 2
Adding support for the Angular 2 router
Setting up the router service
Handling route parameters
Defining child routers
The Router lifecycle hooks
Summary
Chapter 8: Forms and Authentication Handling in Angular 2
Two-way data binding in Angular 2
Tracking control interaction and validating input
Controls, ControlGroups, and the FormBuilder class
A real example – our login component
Mocking a client authentication service
Running the extra mile on access management
Summary
Chapter 9: Animating Components with Angular 2
Creating animations with plain vanilla CSS
Animating components with the AnimationBuilder
Developing custom animation directives
Looking into the future with ngAnimate 2.0
Summary
Chapter 10: Unit testing in Angular 2
Why do we need tests?
Parts of a unit test in Angular 2
Setting up our test environment
Angular 2 custom matcher functions
Testing pipes
Testing components
Testing routes
Testing services
Testing directives
The road ahead
Summary

What You Will Learn

  • Set up your working environment in order to have all the tools you need to start building Angular 2 components with minimum effort
  • Get up to speed with TypeScript, a powerful typed superset of JavaScript that compiles to plain JavaScript
  • Take full control of how your data is rendered and updated upon data changes
  • Build powerful web applications based on structured component hierarchies that emit and listen to events and data changes throughout the elements tree
  • Explore how to consume external APIs and data services and allow data editing by harnessing the power of web forms made with Angular 2
  • Deliver seamless web navigation experiences with application routing and state handling common features with ease
  • Discover how to bulletproof your applications by introducing smart unit testing techniques and debugging tools

Authors

Table of Contents

Chapter 1: Creating Our Very First Component in Angular 2
A fresh start
Setting up our workspace
Hello, Angular 2!
Enhancing our IDE
Diving deeper into Angular 2 components
Summary
Chapter 2: Introducing TypeScript
Understanding the case for TypeScript
Types in TypeScript
Functions, lambdas, and execution flow
Classes, interfaces, and class inheritance
Decorators in TypeScript
Organizing our applications with modules
The road ahead
Summary
Chapter 3: Implementing Properties and Events in Our Components
A better template syntax
Configuring our template from our component class
Summary
Chapter 4: Enhancing Our Components with Pipes and Directives
Directives in Angular 2
Manipulating template bindings with Pipes
Putting it all together in the Pomodoro task list
Building our own custom pipes
Building our own custom directives
A word about naming conventions for custom directives and pipes
Summary
Chapter 5: Building an Application with Angular 2 Components
Introducing the component tree
Common conventions for scalable applications
How dependency injection works in Angular 2
Introducing the Pomodoro App directory structure
Refactoring our application the Angular 2 way
Summary
Chapter 6: Asynchronous Data Services with Angular 2
Strategies for handling asynchronous information
Reactive functional programming in Angular 2
Introducing the HTTP API
A real case study – serving Observable data through HTTP
Summary
Chapter 7: Routing in Angular 2
Adding support for the Angular 2 router
Setting up the router service
Handling route parameters
Defining child routers
The Router lifecycle hooks
Summary
Chapter 8: Forms and Authentication Handling in Angular 2
Two-way data binding in Angular 2
Tracking control interaction and validating input
Controls, ControlGroups, and the FormBuilder class
A real example – our login component
Mocking a client authentication service
Running the extra mile on access management
Summary
Chapter 9: Animating Components with Angular 2
Creating animations with plain vanilla CSS
Animating components with the AnimationBuilder
Developing custom animation directives
Looking into the future with ngAnimate 2.0
Summary
Chapter 10: Unit testing in Angular 2
Why do we need tests?
Parts of a unit test in Angular 2
Setting up our test environment
Angular 2 custom matcher functions
Testing pipes
Testing components
Testing routes
Testing services
Testing directives
The road ahead
Summary

Book Details

ISBN 139781785882074
Paperback352 pages
Read More
From 21 reviews

Read More Reviews