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

You're reading from  Angular Projects - Third Edition

Product type Book
Published in Jul 2023
Publisher Packt
ISBN-13 9781803239118
Pages 312 pages
Edition 3rd Edition
Languages
Author (1):
Aristeidis Bampakos Aristeidis Bampakos
Profile icon Aristeidis Bampakos

Table of Contents (13) Chapters

Preface 1. Creating Your First Web Application in Angular 2. Building an SPA Application with Scully and Angular Router 3. Building an Issue Tracking System Using Reactive Forms 4. Building a PWA Weather Application Using Angular Service Worker 5. Building a WYSIWYG Editor for the Desktop Using Electron 6. Building a Mobile Photo Geotagging Application Using Capacitor and 3D Maps 7. Building an SSR Application for a GitHub Portfolio Using Angular 8. Building an Enterprise Portal Using Nx Monorepo Tools and NgRx 9. Building a Component UI Library Using Angular CLI and Angular CDK 10. Customizing Angular CLI Commands Using Schematics 11. Other Books You May Enjoy
12. Index

Enabling offline mode with the service worker

Users from anywhere can now access our Angular application to get weather information for any city they are interested in. When we say anywhere, we mean any network type, such as broadband, cellular (3G/4G/5G), and Wi-Fi. Consider the case where a user is in a place with low coverage or frequent network outages. How is our application going to behave? Let’s find out by experimenting:

  1. Run the Angular application using the ng serve command of the Angular CLI.
  2. Open your favorite browser and navigate to http://localhost:4200, the default address and port number for an Angular CLI project. You should see the input field for entering the name of the city:
Εικόνα που περιέχει κείμενο  Περιγραφή που δημιουργήθηκε αυτόματα

Figure 4.3 – Entering the name of a city

  1. Open the developer tools of your browser and navigate to the Network tab. Set the value of the Throttling dropdown to Offline:
Figure 4.3 – Offline network mode

Figure 4.4 – Offline network mode

  1. Try...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}