Book Image

Learning Angular - Third Edition

By : Aristeidis Bampakos, Pablo Deeleman
Book Image

Learning Angular - Third Edition

By: Aristeidis Bampakos, Pablo Deeleman

Overview of this book

Angular, loved by millions of web developers around the world, continues to be one of the top JavaScript frameworks thanks to its regular updates and new features that enable fast, cross-platform, and secure frontend web development. With Angular, you can achieve high performance using the latest web techniques and extensive integration with web tools and integrated development environments (IDEs). Updated to Angular 10, this third edition of the Learning Angular book covers new features and modern web development practices to address the current frontend web development landscape. If you are new to Angular, this book will give you a comprehensive introduction to help you get you up and running in no time. You'll learn how to develop apps by harnessing the power of the Angular command-line interface (CLI), write unit tests, style your apps by following the Material Design guidelines, and finally deploy them to a hosting provider. The book is especially useful for beginners to get to grips with the bare bones of the framework needed to start developing Angular apps. By the end of this book, you’ll not only be able to create Angular applications with TypeScript from scratch but also enhance your coding skills with best practices.
Table of Contents (19 chapters)
1
Section 1: Getting Started with Angular
4
Section 2: Components – the Basic Building Blocks of an Angular App
9
Section 3: User Experience and Testability
15
Section 4: Deployment and Practice

Creating an Angular app with routing

Whenever we have created a new Angular app through the course of this book so far, the Angular CLI has asked us whether we wanted to add routing, and we have always replied no. Well, it is time to respond positively and enable routing to our Angular app! In the following sections, we will put into practice all the basics that we have learned about routing:

  • Scaffolding an Angular 10 app with routing
  • Adding route configuration to our Angular app
  • Navigating to application routes

At the end of this section, we will have built a simple Angular 10 app with complete routing capabilities.

Scaffolding an Angular app with routing

We are going to use the Angular CLI to create a new Angular 10 app from scratch:

  1. Execute the ng new Angular CLI command to create an Angular app named my-app.
  2. Type y (yes) to the question asking whether we would like to add routing to our app, and then press Enter.
  3. Accept the default CSS...