Angular in Action

Book Description

Angular in Action teaches you everything you need to build production-ready Angular applications. You'll start coding immediately, as you move from the basics to advanced techniques like testing, dependency injection, and performance tuning. Along the way, you'll take advantage of TypeScript and ES2015 features to write clear, well-architected code. Thoroughly practical and packed with tricks and tips, this hands-on tutorial is perfect for web devs ready to build web applications that can handle whatever you throw at them.

Table of Contents

  1. preface
  2. acknowledgments
  3. about this book
  4. about the author
  5. about the cover illustration
  6. Chapter 1: Angular: a modern web platform
    1. 1.1 Why choose Angular?
    2. 1.2 What you’ll learn
    3. 1.3 The journey from AngularJS to Angular
    4. 1.4 Angular: a platform, not a framework
      1. 1.4.1 Angular CLI
      2. 1.4.2 Server rendering and the compiler
      3. 1.4.3 Mobile and desktop capabilities
      4. 1.4.4 UI libraries
    5. 1.5 Component architecture
      1. 1.5.1 Components’ key characteristics
      2. 1.5.2 Shadow DOM
      3. 1.5.3 Templates
      4. 1.5.3 JavaScript modules
    6. 1.6 Modern JavaScript and Angular
      1. 1.6.1 Observables
    7. 1.7 TypeScript and Angular
    8. Summary
  7. Chapter 2: Building your first Angular app
    1. 2.1 Previewing the chapter project
    2. 2.2 Setting up the project
    3. 2.3 The basic app scaffolding
    4. 2.4 How Angular renders the base application
      1. 2.4.1 App component
      2. 2.4.2 App module
      3. 2.4.3 Bootstrapping the app
    5. 2.5 Building services
    6. 2.6 Creating your first component
    7. 2.7 Components that use components and services
    8. 2.8 Components with forms and events
    9. 2.9 Application routing
    10. Summary
  8. Chapter 3: App essentials
    1. 3.1 Entities in Angular
      1. 3.1.1 Modules
      2. 3.1.2 Components
      3. 3.1.3 Directives
      4. 3.1.4 Pipes
      5. 3.1.5 Services
    2. 3.2 How Angular begins to render an app
    3. 3.3 Types of compilers
    4. 3.4 Dependency injection
    5. 3.5 Change detection
    6. 3.6 Template expressions and bindings
      1. 3.6.1 Interpolation
      2. 3.6.2 Property bindings
      3. 3.6.3 Special property bindings
      4. 3.6.4 Attribute bindings
      5. 3.6.5 Event bindings
    7. Summary
  9. Chapter 4: Component basics
    1. 4.1 Setting up the chapter example
      1. 4.1.1 Getting the code
    2. 4.2 Composition and lifecycle of a component
      1. 4.2.1 Component lifecycle
      2. 4.2.2 Lifecycle hooks
      3. 4.2.3 Nesting components
    3. 4.3 Types of components
    4. 4.4 Creating a Data component
    5. 4.5 Using inputs with components
      1. 4.5.1 Input basics
      2. 4.5.2 Intercepting inputs
    6. 4.6 Content projection
    7. Summary
  10. Chapter 5: Advanced components
    1. 5.1 Change detection and optimizations
    2. 5.2 Communicating between components
      1. 5.2.1 Output events and template variables
      2. 5.2.2 View Child to reference components
    3. 5.3 Styling components and encapsulation modes
      1. 5.3.1 Adding styles to a component
      2. 5.3.2 Encapsulation modes
    4. 5.4 Dynamically rendering components
      1. 5.4.1 Using the Ng-bootstrap modal for dynamic components
      2. 5.4.2 Dynamically creating a component and rendering it
    5. Summary
  11. Chapter 6: Services
    1. 6.1 Setting up the chapter example
      1. 6.1.1 Getting the chapter files
      2. 6.1.2 Sample data
    2. 6.2 Creating Angular services
    3. 6.3 Dependency injection and injector trees
    4. 6.4 Services without dependency injection
    5. 6.5 Using the HttpClient service
      1. 6.5.1 HttpInterceptor
    6. 6.6 Helper services
    7. 6.7 Services for sharing
    8. 6.8 Additional services
    9. Summary
  12. Chapter 7: Routing
    1. 7.1 Setting up the chapter example
    2. 7.2 Route definitions and router setup
    3. 7.3 Feature modules and routing
    4. 7.4 Route parameters
      1. 7.4.1 Creating links in templates with routerLink
      2. 7.4.2 Accessing the route parameters in a component
    5. 7.5 Child routes
    6. 7.6 Secondary routes
      1. 7.6.1 Defining a secondary route
      2. 7.6.2 Navigating between secondary routes
      3. 7.6.3 Closing a secondary route and programmatic routing
    7. 7.7 Route guards to limit access
    8. 7.8 Lazy loading
    9. 7.9 Routing best practices
    10. Summary
  13. Chapter 8: Building custom directives and pipes
    1. 8.1 Setting up the chapter example
    2. 8.2 Crafting custom directives
      1. 8.2.1 Creating an attribute directive
      2. 8.2.2 Modifying a component with a directive with events
      3. 8.2.3 Creating a structural directive
    3. 8.3 Crafting custom pipes
      1. 8.3.1 Creating a pure pipe
      2. 8.3.2 Creating an impure pipe
    4. Summary
  14. Chapter 9: Forms
    1. 9.1 Setting up the chapter example
      1. 9.1.1 Review the app before starting
    2. 9.2 Template-driven forms
      1. 9.2.1 Binding model data to inputs with NgModel
      2. 9.2.2 Validating form controls with NgModel
      3. 9.2.3 Custom validation with directives
      4. 9.2.4 Handling submit or cancel events
    3. 9.3 Reactive forms
      1. 9.3.1 Defining your form
      2. 9.3.2 Implementing the template
      3. 9.3.3 Watching changes
      4. 9.3.4 Custom validators with reactive forms
      5. 9.3.5 Handling submit or cancel events
      6. 9.3.6 Which form approach is better?
    4. 9.4 Custom form controls
    5. Summary
  15. Chapter 10: Testing your application
    1. 10.1 Testing tools and setting up the chapter example
      1. 10.1.1 Testing tools
    2. 10.2 Unit testing
      1. 10.2.1 Anatomy of unit tests
      2. 10.2.2 Testing pipes
      3. 10.2.3 Testing services, stubs, and mocking HTTP requests
      4. 10.2.4 Testing components and using testing modules
      5. 10.2.5 Testing directives
    3. 10.3 e2e testing
    4. 10.4 Additional testing strategies
      1. 10.4.1 How much testing is enough?
      2. 10.4.2 When do I write tests?
      3. 10.4.3 What do I write, e2e or unit tests?
      4. 10.4.4 What if I don’t have time to write tests?
      5. 10.4.5 What about other types of testing?
    5. Summary
  16. Chapter 11: Angular in production
    1. 11.1 Building Angular for production
      1. 11.1.1 Production build
      2. 11.1.2 Optimizing for target browsers
      3. 11.1.3 Progressive Web Apps
      4. 11.1.4 Internationalization (i18n)
      5. 11.1.5 Using alternative build tooling
      6. 11.1.6 Server-side rendering or pre-rendering
      7. 11.1.7 Build pipelines
    2. 11.2 Angular architecture choices
      1. 11.2.1 Lazy load routes
      2. 11.2.2 Reduce external dependencies
      3. 11.2.3 Stay up-to-date
    3. 11.3 Deployment
    4. Summary
  17. Appendix A: Upgrading from AngularJS to Angular
    1. A.1 Option 1: Don’t upgrade
    2. A.2 Option 2: Rewrite from scratch
    3. A.3 Option 3: Incrementally upgrade
    4. Summary
  18. Index

Product Information

  • Title: Angular in Action
  • Author(s): Jeremy Wilken
  • Release date: March 2018
  • Publisher(s): Manning Publications
  • ISBN: 9781617293313