Effective Angular Develop Applications of Any Size by Effectively Using Angular with Nx, RxJS, Ngrx, and Cypress
Chapter 3: Enhancing Your Applications with Directives, Pipes, and Animations -- Using and creating Angular directives -- Angular attribute directives -- Angular structural directives -- Directive selectors -- Angular directive composition -- Transforming values using Angular pipes -- Using pipes in...
Otros Autores: | |
---|---|
Formato: | Libro electrónico |
Idioma: | Inglés |
Publicado: |
Birmingham, England :
Packt Publishing
[2024]
|
Edición: | First edition |
Materias: | |
Ver en Biblioteca Universitat Ramon Llull: | https://discovery.url.edu/permalink/34CSUC_URL/1im36ta/alma991009842234306719 |
Tabla de Contenidos:
- Cover
- Title Page
- Copyright and Credits
- Contributors
- Table of Contents
- Preface
- Part 1: Angular Basics and Setting Up Scalable Nx Workspaces
- Chapter 1: Scalable Front-End Architecture for Angular Applications
- Technical requirements
- Understanding scalable front-end applications
- What is scalability?
- Why is front-end architecture important?
- Different approaches to scaling front-end applications
- Monorepo or polyrepo
- Architectural patterns for Angular applications
- Design patterns used within Angular applications
- What is Nx and why should you use it?
- How Nx helps you build Angular monorepos that scale
- Setting up a scalable Angular workspace
- What did Nx create in our new workspace?
- Improving our Nx workspace for better Angular development
- Structuring Angular applications and libraries
- Do you create a new library or reuse an existing one?
- Summary
- Chapter 2: Powerful Angular Features
- What makes Angular so powerful?
- New features in the Angular framework
- Standalone components
- Dependency injection using the inject function
- Directive composition
- Angular Signals
- Angular control flow
- Other noteworthy new Angular features
- A deep dive into Angular routing
- Creating new components
- Configuring routes in Angular applications
- Route configuration options
- Component communication
- Receiving values with the @input() decorator
- Emitting values with the @Output() decorator
- Two-way data binding using @Input and @Output
- Other component communication methods
- Dependency injection
- Providing dependencies
- Injecting dependencies
- Using the inject function for better dependency injection
- Dependency instances, injector hierarchy, and resolution modifiers
- Summary
- Chapter 3: Enhancing Your Applications with Directives, Pipes, and Animations.
- Using and creating Angular directives
- Angular attribute directives
- Angular structural directives
- Directive selectors
- Angular directive composition
- Transforming values using Angular pipes
- Using pipes in HTML templates and TypeScript files
- Is it pure or impure?
- Using AsyncPipe
- Building your own pipes
- Creating and reusing stunning animations
- Summary
- Chapter 4: Building Forms Like a Pro
- Understanding the different types of forms in Angular
- Building template-driven forms
- Creating a forms library with a form component
- Creating a template-driven form
- Building reactive forms
- Creating a reactive form
- Creating forms dynamically
- Summary
- Part 2: Handling Application State and Writing Cleaner, More Scalable Code
- Chapter 5: Creating Dynamic Angular Components
- A deep dive into Angular content projection
- Creating a modal component using content projection
- Exploring multi-slot content projection with ng-content select
- Displaying projected content multiple times or conditionally
- Using template references and variables
- Using template variables effectively
- Using TemplateRef elements effectively
- Rendering components dynamically
- Rendering components dynamically using ngComponentOutlet
- Using an injector with ngComponentOutlet
- Lazy loading dynamic components
- Rendering components dynamically using the defer control flow
- Summary
- Chapter 6: Applying Code Conventions and Design Patterns in Angular
- Exploring commonly used code conventions and best practices in Angular applications
- Naming conventions
- Structural conventions
- Using best practices in Angular applications
- Exploring commonly used design patterns in Angular applications
- Creational design patterns in Angular
- Structural design patterns in Angular
- Behavioral design patterns in Angular.
- Building a generic HTTP service containing a model adapter
- Using the generic HTTP service
- Providing mock data for our API requests
- Summary
- Chapter 7: Mastering Reactive Programming in Angular
- What is reactive programming?
- Highlights of reactive programming
- Drawbacks of reactive programming
- Reactive programming in Angular
- Reactive programming using RxJS
- What are Observables?
- Unsubscribing from Observables
- Using and creating RxJS operators
- Types of operators
- Flattening multiple Observable streams using flattening operators
- Powerful and useful RxJS operators
- Creating combined and reusable RxJS operators
- Reactive programming using Angular Signals
- Using Signals, computed Signals, and Signals effects
- Combining Signals and RxJS
- Using toSignal
- Using toObservable
- Choosing between Signals and RxJS
- Summary
- Chapter 8: Handling Application State with Grace
- Understanding application state
- Different levels of application state
- Fundamental concepts within state management
- Handling global application state using RxJS
- Building a state management solution using RxJS
- Connecting your state management and view layer with a facade service
- Handling global application state using Signals
- The problem with using RxJS or Signals for global state management
- Handling global application state with NgRx
- Installing the @ngrx/store and @ngrx/effects packages
- Defining your first NgRx actions
- Creating your first NgRx effect
- Creating your initial state and first reducer functions
- Defining NgRx selectors
- Adjusting the facade service so that they use NgRx state management
- Adding additional actions, effects, reducers, and selectors
- Summary
- Part 3: Getting Ready for Production with Automated Tests, Performance, Security, and Accessibility.
- Chapter 9: Enhancing the Performance and Security of Angular Applications
- Understanding Angular change detection
- Zone.js and Angular
- Improving change detection efficiency
- Angular change detection and Signals
- Enhancing the performance of Angular applications
- Understanding and using the runOutsideAngular() method
- Understanding and using the NgOptimizedImage directive
- Understanding and using the trackBy and track functions
- Understanding and using web workers in Angular
- Building secure Angular applications
- Setting up route guards
- Angular attack surfaces and how to mitigate them
- Summary
- Chapter 10: Internationalization, Localization, and Accessibility of Angular Applications
- Adding translatable content in Angular applications
- Installing Transloco in your Nx monorepo
- Translating content using Transloco
- Changing the Transloco configurations at runtime
- Localization for Angular applications
- Localizing currencies using the translocoCurrency pipe
- Localizing dates using the translocoDate pipe
- Localizing numbers using the translocoDecimal pipe
- Making your Angular applications accessible to everyone
- How to make Angular applications accessible
- Using the tabindex attribute
- Adding ARIA attributes
- Summary
- Chapter 11: Testing Angular Applications
- Different types of application testing
- Understanding unit tests
- Understanding end-to-end tests
- Understanding component tests
- Understanding integration tests
- Unit testing of Angular applications using Jest
- Setting the coverage threshold
- Adding additional configurations
- Writing and running unit tests
- Adding additional unit tests for the expenses-registration application
- End-to-end testing of Angular applications using Cypress
- Writing your first e2e test
- Defining page objects for e2e testing.
- Using fixtures in your e2e tests
- Summary
- Chapter 12: Deploying Angular Applications
- Building and linting Angular applications inside your Nx monorepo
- Linting Nx projects
- Building your Angular libraries and applications
- Analyzing your build output
- Automatically deploying Angular applications
- Creating an access token
- Creating a .yml file
- Deploying the application to GitHub Pages
- Fixing workflow fails
- Summary
- Index
- Other Books You May Enjoy.