Welcome to the wonderful world of web development! This book has been designed to teach you the fundamentals of the Angular platform and equip you with useful recipes and practical code examples, so you can create rich and scalable line-of-business applications. The book emphasizes a minimalist approach, by maximizing the use of built-in libraries and avoiding the introduction of additional third-party dependencies to achieve the desired outcome. As a result of this approach, your code will be easier to maintain and upgrade, as new versions of Angular are released frequently. You may continue using this book as a learning resource, as the fundamental concepts, technologies, and samples included in the book will remain relevant for some time to come, albeit with slight modifications. The tools and services recommended in the book have been updated to their latest versions, circa 2020, however, tools and services continually evolve, change, and sometimes outright disappear. If and when this happens, feel free to reach out to me for alternatives.
This book will also aim to instill an Agile and DevOps mindset in you so that you confidently create reliable and flexible solutions. Whether you consider yourself a freelancer developing software for small businesses, a full-stack developer, an enterprise developer, or a web developer, what you need to know to design, architect, develop, maintain, deliver, and deploy a web application, and the best practices and patterns you need to apply to achieve those things, don't vary all that much. If you are delivering an application to an audience of users, in a sense, you are a full-stack developer, since you must be aware of a lot of server technologies. In fact, if you master how to deliver Angular applications using TypeScript, it won't be difficult for you to write your own RESTful APIs using Node.js, Express.js, and TypeScript, which is demonstrated through a concrete implementation later in the book.
By some definitions, a full-stack developer needs to know everything from catering to international copyright law to successfully create and operate an application on today's web. If you're an entrepreneur, in a sense, this is true. However, in this book, your culinary skills and law degrees need not apply. This book assumes that you already know how to work with web development basics and have familiarity working with RESTful APIs with the tech stack of your choice, and if not, fear not, just follow the hands-on step-by-step instructions and you will be able to create your first API-enabled Angular app in no time.
This book is for beginners and experienced developers alike who are looking to learn Angular or web development in general. If you are an Angular developer, you will be exposed to the entire gamut of designing and deploying an Angular application to production. You will learn about Angular patterns that are easy to understand and teach others. If you are a freelancer, you will pick up effective tools and technologies to deliver your Angular app in a secure, confident, and reliable way. If you're an enterprise developer, you will learn patterns and practices to write Angular applications with a scalable architecture.
Chapter 1, Introduction to Angular and Its Concepts, introduces the reader to the world of Angular and web development.
Chapter 2, Setting Up Your Development Environment, goes over a scriptable way to set up your environment.
Chapter 3, Creating a Basic Angular App, introduces the Kanban method of software development with easy-to-use design tools used to communicate ideas, going over Angular fundamentals, and leveraging CLI tools to maximize your impact.
Chapter 4, Automated Testing, CI, and Release to Production, covers unit testing, continuous integration, and rapid cloud deployments.
Chapter 5, Delivering High-Quality UX with Material, introduces you to Angular Material and explains how to use it to build great-looking apps.
Chapter 6, Forms, Observables, and Subjects, teaches you to become comfortable using Angular forms and reactive programming with RxJS.
Chapter 7, Creating a Router-First Line-of-Business App, focuses on the Router-first architecture, a seven-step approach to the design and development of mid-to-large line-of-business applications.
Chapter 8, Designing Authentication and Authorization, dives into authentication and authorization related patterns in Angular and RESTful applications.
Chapter 9, DevOps Using Docker, dives deep into containerization with Docker to enable repeatable development and operational workflows across diverse ecosystems.
Chapter 10, RESTful APIs and Full-Stack Implementation, walks you through the implementation of a real-world MEAN stack application to support line-of-business applications.
Chapter 11, Recipes – Reusability, Routing, and Caching, contains recipes around capturing and manipulating user data commonly needed for line-of-business applications.
Chapter 12, Recipes – Master/Detail, Data Tables, and NgRx, contains recipes around presenting user data commonly needed for line-of-business applications and an introduction to implementing the Flux pattern in Angular using NgRx.
Chapter 13, Highly Available Cloud Infrastructure on AWS, moves beyond application features to go over provisioning a highly-available cloud infrastructure on AWS.
Chapter 14, Google Analytics and Advanced Cloud Ops, goes over the nuances of owning, operating, and optimizing your cloud infrastructure, and using Google Analytics to capture user behavior.
Appendix A, Debugging Angular, covers how to deal with common Angular errors and breakpoint debugging using Chrome DevTools.
Appendix B, Angular Cheat Sheet, is a quick reference for Angular CLI commands, major Angular components, and common RxJS operators.
Appendix C, Keeping Angular and Tools Evergreen, includes detailed information about how to keep your development environment, Angular, and its dependencies up to date. You can read this appendix at https://static.packt-cdn.com/downloads/9781838648800_Appendix_C_Keeping_Angular_and_Tools_Evergreen.pdf. You can alternatively read this appendix at https://expertlysimple.io/stay-evergreen.
Appendix D, Self-Assessment Answers, has the answers to the test questions at the end of each chapter. You can read this appendix at https://static.packt-cdn.com/downloads/9781838648800_Appendix_D_Self-Assessment_Answers.pdf. You can alternatively read this appendix at https://expertlysimple.io/angular-self-assessment/.
You can get the latest version of the example code files for this book on GitHub. There are four projects that directly supports the content in this book:
In each chapter you can find specific instructions to access chapter specific versions of code examples. When demonstrating continuous integration and continuous deployment configuration, Git branches and GitHub pull requests are utilized to demonstrate specific configuration elements.
You can download a snapshot of example code files for this book at the time of publishing from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files emailed directly to you.
You can download the code files by following these steps:
Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:
The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/Angular-for-Enterprise-Ready-Web-Applications-Second-Edition. We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!
We also provide a PDF file that has color images of the screenshots/diagrams used in this book. You can download it here: http://www.packtpub.com/sites/default/files/downloads/9781838648800_ColorImages.pdf.
There are a number of text conventions used throughout this book.
CodeInText
: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. For example; "Mount the downloaded WebStorm-10*.dmg
disk image file as another disk in your system."
A block of code is set as follows:
{
"name": "local-weather-app",
"version": "0.0.0",
"license": "MIT",
...
}
When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
Any cross-platform or macOS specific command-line input or output is written as follows:
$ brew tap caskroom/cask
Windows specific command-line input or output is written as follows:
PS> Set-ExecutionPolicy AllSigned; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
Bold: Indicates a new term, an important word, or words that you see on the screen, for example, in menus or dialog boxes, also appear in the text like this. For example: "Browser vendors are supposed to implement these technologies as defined by the World Wide Web Consortium (W3C)."
Warnings or important notes appear like this.
Tips and tricks appear like this.
Feedback from our readers is always welcome.
General feedback: Email feedback@packtpub.com
, and mention the book's title in the subject of your message. If you have questions about any aspect of this book, please email us at questions@packtpub.com
.
Errata: Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you have found a mistake in this book we would be grateful if you would report this to us. Please visit, http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details.
Piracy: If you come across any illegal copies of our works in any form on the Internet, we would be grateful if you would provide us with the location address or website name. Please contact us at copyright@packtpub.com
with a link to the material.
If you are interested in becoming an author: If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, please visit http://authors.packtpub.com.
Please leave a review. Once you have read and used this book, why not leave a review on the site that you purchased it from? Potential readers can then see and use your unbiased opinion to make purchase decisions, we at Packt can understand what you think about our products, and our authors can see your feedback on their book. Thank you!
For more information about Packt, please visit packtpub.com.