Angular 2 By Example

Discover everything you need to know to build your own Angular 2 applications the hands-on way

Angular 2 By Example

This ebook is included in a Mapt subscription
Chandermani Arora, Kevin Hennessy

5 customer reviews
Discover everything you need to know to build your own Angular 2 applications the hands-on way
$10.00
$44.99
RRP $35.99
RRP $44.99
eBook
Print + eBook
Access every Packt eBook & Video for just $100
 
  • 4,000+ eBooks & Videos
  • 40+ New titles a month
  • 1 Free eBook/Video to keep every month
Find Out More
 
Preview in Mapt

Book Details

ISBN 139781785887192
Paperback510 pages

Book Description

Angular 2 will help you build faster, more efficient, and more flexible cross-platform applications. Angular 2 is known for taking the pain out of JavaScript development, and enabling more organized, readable, and testable code.

This book builds three apps with varying degrees of complexity. It starts with a simple ‘Guess the Number’ game, which serves as a platform to launch you into the world of Angular. Next, you will learn to construct a popular ‘7-Minute Workout’ app, covering the building blocks of Angular. The final app, ‘Personal Trainer’ morphs the existing ‘7-Minute Workout’ into a full-fledged personal workout builder and runner, covering advanced directive building, which is the most fundamental and powerful feature of Angular.

In addition to this, you will learn about testability and the framework constructs Angular provides to effectively test your app. The book concludes by providing you with practical advice and useful tips that will come in handy as you build more and more apps with Angular.

Table of Contents

Chapter 1: Getting Started
Angular basics
The customary Hello Angular app - Guess the Number!
Digging deeper
Revisiting our app
Looking at how our code handles updates
Maintaining the state
Initializing the app
Tools
Resources
Summary
Chapter 2: Building Our First App - 7 Minute Workout
What is 7 Minute Workout?
Downloading the code base
Setting up the build
Organizing code
The 7 Minute Workout model
App bootstrapping
Our first component - WorkoutRunnerComponent
Building the 7 Minute Workout view
Exploring Angular modules
Learning more about an exercise
Summary
Chapter 3: More Angular 2 – SPA, Routing, and Data Flows in Depth
Exploring Single Page Application capabilities
Angular dependency injection
Tracking workout history
Fixing the video playback experience
Cross-component communication using Angular events
Summary
Chapter 4: Personal Trainer
The Personal Trainer app - the problem scope
Personal Trainer requirements
The Personal Trainer model
Sharing the workout model
The model as a service
The Personal Trainer layout
Personal Trainer navigation with routes
Implementing workout and exercise lists
Building a workout
Angular forms
Summary
Chapter 5: Supporting Server Data Persistence
Angular and server interactions
The basics of the HTTP module
Personal Trainer and server integration
Updating the router guards
Performing CRUD on exercises/workouts
Using promises for HTTP requests
The async pipe
Cross-domain access and Angular
Fixing the 7 Minute Workout app
Summary
Chapter 6: Angular 2 Directives in Depth
Classifying directives
Building a remote validator directive
Building a busy indicator directive
Directive injection
Building an Ajax button component
Dependency injection using viewProvider
Understanding structural directives
Component styling and view encapsulation
Summary
Chapter 7: Testing Personal Trainer
The need for automation
Testing in Angular
Getting started with unit testing
Getting started with E2E testing
Summary
Chapter 8: Some Practical Scenarios
Building a new app
Seed projects
Seed and scaffolding tools
Angular 2 performance
Handling authentication and authorization
Migrating Angular 1 apps
Migrating Angular 1's Personal Trainer
Summary

What You Will Learn

  • Design, develop, deploy, and test the apps you build
  • Work your way through every aspect of app development using Angular2
  • Understand the inner workings of Angular’s view templating and data-binding capabilities
  • Work on HTML forms and learn the Angular way to bind, validate, and format data
  • Create component, structural, and attribute directives to extend standard HTML behavior
  • Integrate with the server backend and find out about data retrieval and persistence using Angular
  • Gain practical insight into the challenges of building apps using Angular as well as their solutions

Authors

Table of Contents

Chapter 1: Getting Started
Angular basics
The customary Hello Angular app - Guess the Number!
Digging deeper
Revisiting our app
Looking at how our code handles updates
Maintaining the state
Initializing the app
Tools
Resources
Summary
Chapter 2: Building Our First App - 7 Minute Workout
What is 7 Minute Workout?
Downloading the code base
Setting up the build
Organizing code
The 7 Minute Workout model
App bootstrapping
Our first component - WorkoutRunnerComponent
Building the 7 Minute Workout view
Exploring Angular modules
Learning more about an exercise
Summary
Chapter 3: More Angular 2 – SPA, Routing, and Data Flows in Depth
Exploring Single Page Application capabilities
Angular dependency injection
Tracking workout history
Fixing the video playback experience
Cross-component communication using Angular events
Summary
Chapter 4: Personal Trainer
The Personal Trainer app - the problem scope
Personal Trainer requirements
The Personal Trainer model
Sharing the workout model
The model as a service
The Personal Trainer layout
Personal Trainer navigation with routes
Implementing workout and exercise lists
Building a workout
Angular forms
Summary
Chapter 5: Supporting Server Data Persistence
Angular and server interactions
The basics of the HTTP module
Personal Trainer and server integration
Updating the router guards
Performing CRUD on exercises/workouts
Using promises for HTTP requests
The async pipe
Cross-domain access and Angular
Fixing the 7 Minute Workout app
Summary
Chapter 6: Angular 2 Directives in Depth
Classifying directives
Building a remote validator directive
Building a busy indicator directive
Directive injection
Building an Ajax button component
Dependency injection using viewProvider
Understanding structural directives
Component styling and view encapsulation
Summary
Chapter 7: Testing Personal Trainer
The need for automation
Testing in Angular
Getting started with unit testing
Getting started with E2E testing
Summary
Chapter 8: Some Practical Scenarios
Building a new app
Seed projects
Seed and scaffolding tools
Angular 2 performance
Handling authentication and authorization
Migrating Angular 1 apps
Migrating Angular 1's Personal Trainer
Summary

Book Details

ISBN 139781785887192
Paperback510 pages
Read More
From 5 reviews

Read More Reviews