Angular Design Patterns

Book description

Make the most of Angular by leveraging design patterns and best practices to build stable and high performing apps

Key Features

  • Get to grips with the benefits and applicability of using different design patterns in Angular with the help of real-world examples
  • Identify and prevent common problems, programming errors, and anti-patterns
  • Packed with easy-to-follow examples that can be used to create reusable code and extensible designs

Book Description

This book is an insightful journey through the most valuable design patterns, and it will provide clear guidance on how to use them effectively in Angular. You will explore some of the best ways to work with Angular and how to use it to meet the stability and performance required in today's web development world. You'll get to know some Angular best practices to improve your productivity and the code base of your application.

We will take you on a journey through Angular designs for the real world, using a combination of case studies, design patterns to follow, and anti-patterns to avoid.

By the end of the book, you will understand the various features of Angular, and will be able to apply well-known, industry-proven design patterns in your work.

What you will learn

  • Understand Angular design patterns and anti-patterns
  • Implement the most useful GoF patterns for Angular
  • Explore some of the most famous navigational patterns for Angular
  • Get to know and implement stability patterns
  • Explore and implement operations patterns
  • Explore the official best practices for Angular
  • Monitor and improve the performance of Angular applications

Who this book is for

If you want to increase your understanding of Angular and apply it to real-life application development, then this book is for you.

Table of contents

  1. Title Page
  2. Copyright and Credits
    1. Angular Design Patterns
  3. Packt Upsell
    1. Why subscribe?
    2. PacktPub.com
  4. Contributors
    1. About the author
    2. About the reviewer
    3. Packt is searching for authors like you
  5. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
      1. Download the example code files
      2. Download the color images
      3. Conventions used
    4. Get in touch
      1. Reviews
  6. TypeScript Best Practices
    1. Environment setup
      1. Node.js and npm for Linux
      2. TypeScript
    2. Quick overview
    3. Best practices
      1. Naming
      2. Interface redefinitions
      3. Getters and setters
      4. Constructor
      5. Type guards
      6. Enumerator
      7. Pitfalls
        1. Type-casting and JSON
        2. Inheritance and polymorphism
    4. Summary
  7. Angular Bootstrapping
    1. Architectural overview
      1. Component
      2. Services
      3. Directives
      4. Pipes
      5. Routes
    2. Angular CLI
      1. Installation
      2. Creating a new application
      3. Generating
      4. Serving
      5. Deploying
    3. Summary
  8. Classical Patterns
    1. Components
    2. Singleton
    3. Factory method
    4. Observer
      1. TypeScript observables with parameters
      2. Observing HTTP responses
        1. Implementation
        2. Understanding the implementation
      3. Promises
    5. Summary
  9. Navigational Patterns
    1. MVC
      1. Model-view-controller at large
        1. Model-view-controller limitations for the frontend
      2. Angular's model-view-controller
    2. Redux
    3. Summary
  10. Stability Patterns
    1. Timeouts
    2. Circuit breaker 
    3. Factory
    4. Memento
    5. Summary
  11. Performance Patterns
    1. AJAX overkill
    2. Proxy patterns
    3. Loop count
      1. Change detection and immutable states
    4. Prototype and the reusable pool
    5. Summary
  12. Operation Patterns
    1. General health metrics
    2. Specific metrics
      1. Error reporting
      2. Method metrics with AOP
    3. Summary
  13. Other Books You May Enjoy
    1. Leave a review - let other readers know what you think

Product information

  • Title: Angular Design Patterns
  • Author(s): Mathieu Nayrolles
  • Release date: July 2018
  • Publisher(s): Packt Publishing
  • ISBN: 9781786461728