Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Angular Projects - Third Edition
Angular Projects - Third Edition

Angular Projects: Build modern web apps in Angular 16 with 10 different projects and cutting-edge technologies, Third Edition

By Aristeidis Bampakos
$33.99 $22.99
Book Jul 2023 312 pages 3rd Edition
eBook
$33.99 $22.99
Print
$41.99
Subscription
$15.99 Monthly
eBook
$33.99 $22.99
Print
$41.99
Subscription
$15.99 Monthly

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Buy Now

Product Details


Publication date : Jul 19, 2023
Length 312 pages
Edition : 3rd Edition
Language : English
ISBN-13 : 9781803239118
Vendor :
Google
Category :
Table of content icon View table of contents Preview book icon Preview Book

Angular Projects - Third Edition

Angular Projects, Third Edition: Build modern web apps in Angular 16 with 10 different projects and cutting-edge technologies

Welcome to Packt Early Access. We’re giving you an exclusive preview of this book before it goes on sale. It can take many months to write a book, but our authors have cutting-edge information to share with you today. Early Access gives you an insight into the latest developments by making chapter drafts available. The chapters may be a little rough around the edges right now, but our authors will update them over time.You can dip in and out of this book or follow along from start to finish; Early Access is designed to be flexible. We hope you enjoy getting to know more about the process of writing a Packt book.

  1. Chapter 1: Creating Your First Web Application in Angular
  2. Chapter 2: Building an SPA Application with Scully and Angular Router
  3. Chapter 3: Building an Issue Tracking System Using Reactive Forms
  4. Chapter 4: Building a PWA...

Essential background theory and context

The Angular framework is a cross-platform JavaScript framework that can run on various environments, including the web, server, mobile, and desktop. It consists of a collection of JavaScript libraries that we can use to build highly performant and scalable web applications. The architecture of an Angular application is based on a hierarchical representation of components. Components are the fundamental building blocks of an Angular application. They represent and control a particular portion of a web page called the view. Some examples of components are as follows:

  • A list of blog posts
  • An issue reporting form
  • A weather display widget

Components of an Angular application can be logically organized as a tree:

Figure 1.1 – Component tree

Figure 1.1 – Component tree

An Angular application typically has one main component by convention, called AppComponent. Each component in the tree can communicate and interact with its siblings...

Introduction to the Angular CLI

The Angular CLI is a tool created by the Angular team that improves the developer experience while building Angular applications. It hides the complexity of scaffolding and configuring an Angular application while allowing developers to concentrate on what they do best – coding! Before we can start using the Angular CLI, we need to set up the following prerequisites in our system:

  • Node.js: A JavaScript runtime that is built on the v8 engine of Chrome. You can download any Long-Term Support (LTS) version from https://nodejs.org.
  • npm: A package manager for the Node.js runtime.

We can then install the Angular CLI using npm from the command line:

npm install -g @angular/cli

We use the -g option to install the Angular CLI globally, since we want to create Angular applications from any operating system path.

Installing the Angular CLI may require administrative privileges in some operating systems.

...

Exploring the rich ecosystem of Angular tooling in VS Code

There are many extensions available in the VS Code Marketplace that enhance the Angular tooling ecosystem. In this section, we will learn about the most popular ones that can significantly help us in Angular development:

  • Nx Console
  • Angular Language Service
  • Angular Snippets
  • Angular Evergreen
  • Material Icon Theme

The preceding list is not exhaustive; some extensions are already included in the Angular Essentials extension pack. However, you can browse more Angular extensions for VS Code at https://marketplace.visualstudio.com/search?term=angular&target=VSCode.

Nx Console

Nx Console is a VS Code extension developed by the Nrwl team that provides a graphical user interface over the Angular CLI. It contains most of the Angular CLI commands and uses the Angular CLI internally to execute each one. We will learn more about this extension in the Building our application with Nx...

Project overview

In this project, we will use Angular CLI to create a new Angular application from scratch. Then, we will interact with the core functionality of the Angular framework to make a simple change to our application. Finally, we will learn how to use the Nx Console extension to build and serve our application.

Build time: 15 minutes.

Getting started

The following software tools are required to complete this project:

Creating our first Angular application

To create a fresh new Angular application, we must execute the ng new command of the Angular CLI, passing the name of the application as an option:

ng new my-app

The ng new command is used to create a new Angular application or a new Angular workspace. An Angular workspace is an Angular CLI project containing one or more Angular applications, some of which can be Angular libraries. So, when we execute the ng new command, we create an Angular workspace with an Angular application by default.

In the previous command, the name of our Angular application is my-app. Upon executing the command, the Angular CLI will ask some questions to collect as much information as possible regarding the nature of the application we want to create:

  1. Initially, it will ask if we want to enable Angular analytics:
    Would you like to share pseudonymous usage data about this project with the Angular Team at Google under Google's Privacy...

Interacting with the Angular framework

When working with Angular, the real fun starts when we get our hands dirty with the framework itself. After all, understanding how Angular works and writing the application code is what matters.

The application source code resides inside the src\app folder at the root of our Angular CLI project. It contains all the files needed to build and test our Angular application, including a component and a module. The component is the main component of the Angular application:

app.component.ts

import { Component } from '@angular/core';
@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent {
  title = 'my-app';
}

The following properties characterize an Angular component:

  • selector: A unique name used to identify and declare the component inside HTML content. It is an HTML tag, just like any...

Using Nx Console for automating Angular CLI commands

The Angular CLI is a command-line tool with a variety of commands. Each command can accept a wide range of options and parameters according to the task we want to accomplish. Remembering these commands and their options by heart is daunting and time-consuming. In such cases, the ecosystem of Angular tooling can come in handy. VS Code Marketplace contains many useful extensions that we can install to help us during Angular development. One of these extensions is the Nx Console, which provides a user interface over the Angular CLI. To install the Nx Console in your environment, follow these steps:

  1. Open VS Code and click on the Extensions menu in the sidebar:
Figure 1.15 – VSCode Extensions

Figure 1.13 – VS Code Extensions

  1. In the EXTENSIONS pane that appears, type Nx Console.
  2. Click the Install button on the first item to install the Nx Console extension.

The Nx Console extension is now installed globally...

Summary

In this chapter, we learned about the basic principles of the Angular framework and provided a brief overview of the Angular architecture. We saw some popular extensions for VS Code that we can use to enhance our development experience while working with Angular.

Then, we learned how to use the Angular CLI, a powerful tool of the Angular ecosystem, to scaffold and build a new Angular application from scratch. We also made our first interaction with Angular code by modifying the Angular component of a typical Angular CLI application. Finally, we installed the Nx Console extension and learned how to build our application.

In the next chapter, we will look at the Angular Router and learn how to use it to create a personal blog, using the Scully static website generator.

Practice questions

Let’s take a look at a few practice questions:

  1. What is the basic building block of an Angular application?
  2. How do we group components of similar functionality?
  3. Who handles business logic tasks in an Angular application?
  4. Which Angular CLI command can we use to create a new Angular application?
  5. Which Angular CLI command can we use to serve an Angular application?
  6. How do we declare an Angular component in HTML?
  7. How do we declare Angular components in a module?
  8. What syntax do we use to bind text on HTML templates?
  9. What is the benefit of using the Nx Console?
  10. Which extension do we use to perform static analysis in our Angular code?

Further reading

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Explore Angular's capabilities for cross-platform app development
  • Combine Angular with popular web technologies such as Nx monorepos, server-side rendering, and progressive web apps
  • Build your own libraries and schematics using Angular CDK and Angular CL

Description

Angular Projects isn't like other books on Angular – this is a project-based guide that helps budding Angular developers get hands-on experience while developing cutting-edge applications. In this updated third edition, you’ll master the essential features of the framework by creating ten different real-world web applications. Each application will demonstrate how to integrate Angular with a different library and tool, giving you a 360-degree view of what the Angular ecosystem makes possible. Updated to the newest version of Angular, the book has been revamped to keep up with the latest technologies. You’ll work on a PWA weather application, a mobile photo geotagging application, a component UI library, and other exciting projects. In doing so, you’ll implement popular technologies such as Angular Router, Scully, Electron, Angular service workers, Jamstack, NgRx, and more. By the end of this book, you will have the skills you need to build Angular apps using a variety of different technologies according to your or your client’s needs.

What you will learn

Set up Angular applications using Angular CLI and Nx Console Create a personal blog with Jamstack, Scully plugins, and SPA techniques Build an issue management system using typed reactive forms Use PWA techniques to enhance user experience Make SEO-friendly web pages with server-side rendering Create a monorepo application using Nx tools and NgRx for state management Focus on mobile application development using Ionic Develop custom schematics by extending Angular CLI

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Buy Now

Product Details


Publication date : Jul 19, 2023
Length 312 pages
Edition : 3rd Edition
Language : English
ISBN-13 : 9781803239118
Vendor :
Google
Category :

Table of Contents

13 Chapters
Preface Chevron down icon Chevron up icon
Creating Your First Web Application in Angular Chevron down icon Chevron up icon
Building an SPA Application with Scully and Angular Router Chevron down icon Chevron up icon
Building an Issue Tracking System Using Reactive Forms Chevron down icon Chevron up icon
Building a PWA Weather Application Using Angular Service Worker Chevron down icon Chevron up icon
Building a WYSIWYG Editor for the Desktop Using Electron Chevron down icon Chevron up icon
Building a Mobile Photo Geotagging Application Using Capacitor and 3D Maps Chevron down icon Chevron up icon
Building an SSR Application for a GitHub Portfolio Using Angular Chevron down icon Chevron up icon
Building an Enterprise Portal Using Nx Monorepo Tools and NgRx Chevron down icon Chevron up icon
Building a Component UI Library Using Angular CLI and Angular CDK Chevron down icon Chevron up icon
Customizing Angular CLI Commands Using Schematics Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Filter icon Filter
Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Full star icon Full star icon 5
(1 Ratings)
5 star 100%
4 star 0%
3 star 0%
2 star 0%
1 star 0%

Filter reviews by


Faizou Aremou Nov 26, 2023
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Feefo Verified review Feefo image
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.