0%

Book Description

Uncover Angular's potential for creating enterprise web applications—from setting up the environment to deployment—with the help of expert guidance, step-by-step explanations, and hands-on exercises

Key Features

  • Learn the fundamentals of Angular to build web applications using TypeScript
  • Explore the basics of Angular development, from components and templates to forms and services
  • Discover best practices for building, packaging, and testing Angular applications

Book Description

Angular, loved by millions of web developers around the world, continues to be one of the top JavaScript frameworks thanks to its regular updates and new features that enable fast, cross-platform, and secure frontend web development. With Angular, you can achieve high performance using the latest web techniques and extensive integration with web tools and integrated development environments (IDEs).

Updated to Angular 10, this third edition of the Learning Angular book covers new features and modern web development practices to address the current frontend web development landscape. If you are new to Angular, this book will give you a comprehensive introduction to help you get you up and running in no time. You'll learn how to develop apps by harnessing the power of the Angular command-line interface (CLI), write unit tests, style your apps by following the Material Design guidelines, and finally deploy them to a hosting provider. The book is especially useful for beginners to get to grips with the bare bones of the framework needed to start developing Angular apps.

By the end of this book, you'll not only be able to create Angular applications with TypeScript from scratch but also enhance your coding skills with best practices.

What you will learn

  • Use the Angular CLI to scaffold, build, and deploy a new Angular application
  • Build components, the basic building blocks of an Angular application
  • Discover techniques to make Angular components interact with each other
  • Understand the different types of templates supported by Angular
  • Create HTTP data services to access APIs and provide data to components
  • Enhance your application's UX with Angular Material
  • Apply best practices and coding conventions to your large-scale web development projects

Who this book is for

The Angular TypeScript book is for JavaScript and full-stack developers who want to enter the world of frontend development with Angular or migrate to the Angular framework to build professional web applications. Familiarity with web and programming concepts will assist with understanding the content covered in the book.

Book Description

Uncover Angular's potential for creating enterprise web applications—from setting up the environment to deployment—with the help of expert guidance, step-by-step explanations, and hands-on exercises

Key Features

  • Learn the fundamentals of Angular to build web applications using TypeScript
  • Explore the basics of Angular development, from components and templates to forms and services
  • Discover best practices for building, packaging, and testing Angular applications

Book Description

Angular, loved by millions of web developers around the world, continues to be one of the top JavaScript frameworks thanks to its regular updates and new features that enable fast, cross-platform, and secure frontend web development. With Angular, you can achieve high performance using the latest web techniques and extensive integration with web tools and integrated development environments (IDEs).

Updated to Angular 10, this third edition of the Learning Angular book covers new features and modern web development practices to address the current frontend web development landscape. If you are new to Angular, this book will give you a comprehensive introduction to help you get you up and running in no time. You'll learn how to develop apps by harnessing the power of the Angular command-line interface (CLI), write unit tests, style your apps by following the Material Design guidelines, and finally deploy them to a hosting provider. The book is especially useful for beginners to get to grips with the bare bones of the framework needed to start developing Angular apps.

By the end of this book, you'll not only be able to create Angular applications with TypeScript from scratch but also enhance your coding skills with best practices.

What you will learn

  • Use the Angular CLI to scaffold, build, and deploy a new Angular application
  • Build components, the basic building blocks of an Angular application
  • Discover techniques to make Angular components interact with each other
  • Understand the different types of templates supported by Angular
  • Create HTTP data services to access APIs and provide data to components
  • Enhance your application's UX with Angular Material
  • Apply best practices and coding conventions to your large-scale web development projects

Who this book is for

The Angular TypeScript book is for JavaScript and full-stack developers who want to enter the world of frontend development with Angular or migrate to the Angular framework to build professional web applications. Familiarity with web and programming concepts will assist with understanding the content covered in the book.

Table of Contents

  1. Learning Angular Third Edition
  2. Why subscribe?
  3. Contributors
  4. About the authors
  5. About the reviewer
  6. Packt is searching for authors like you
  7. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
    4. Download the example code files
    5. Conventions used
    6. Get in touch
    7. Reviews
  8. Section 1: Getting Started with Angular
  9. Chapter 1: Building Your First Angular App
    1. Technical requirements
    2. It's just Angular – introducing semantic versioning
      1. Patch change
      2. Minor change
      3. Major change
      4. What about Angular?
    3. Introducing Angular
    4. Setting up our workspace with Angular CLI
      1. Prerequisites
      2. Installing Angular CLI
      3. CLI commands
      4. Creating a new project
    5. Hello Angular
      1. Components
      2. Modules
      3. Selector
      4. Template
      5. Bootstrapping
    6. IDEs and plugins
      1. Atom
      2. Sublime Text
      3. WebStorm
      4. Visual Studio Code
    7. Summary
  10. Chapter 2: Introduction to TypeScript
    1. The history of TypeScript
      1. The benefits of TypeScript
      2. Introducing TypeScript resources
    2. Types in TypeScript
      1. String
      2. Declaring variables
      3. Number
      4. Boolean
      5. Array
      6. Dynamic typing with any type
      7. Custom types
      8. Enum
      9. Void
      10. Type inference
    3. Functions, lambdas, and execution flow
      1. Annotating types in our functions
      2. Function parameters in TypeScript
      3. Arrow functions
    4. Common TypeScript features
      1. Spread parameter
      2. Template strings
      3. Generics
    5. Classes, interfaces, and inheritance
      1. Anatomy of a class
      2. Constructor parameters with accessors
      3. Interfaces
      4. Class inheritance
    6. Decorators in TypeScript
      1. Class decorators
      2. Property decorators
      3. Method decorators
      4. Parameter decorator
    7. Advanced types
      1. Partial
      2. Record
      3. Union
      4. Nullable
    8. Modules
    9. Summary
  11. Section 2: Components – the Basic Building Blocks of an Angular App
  12. Chapter 3: Component Interaction and Inter-Communication
    1. Technical requirements
    2. Creating our first component
      1. Component file creation
      2. Module registration
    3. Configuring a component
    4. Interacting with the template
      1. Displaying data from the component
      2. Applying styles to the template
      3. Getting data from the template
    5. Communicating with other components
      1. Passing data using input binding
      2. Listening for events using output binding
      3. Local references in templates
    6. Encapsulating CSS styling
    7. Change detection strategies
    8. Introducing the component lifecycle
      1. Performing component initialization
      2. Cleaning up resources
      3. Detecting input changes
    9. Summary
  13. Chapter 4: Enhance Components with Pipes and Directives
    1. Technical requirements
    2. Introducing directives
    3. Transforming elements using directives
      1. Displaying data conditionally
      2. Iterating through data
      3. Switching through templates
    4. Manipulating data with pipes
    5. Building custom pipes
      1. Sorting data using pipes
      2. Change detection with pipes
    6. Building custom directives
      1. Displaying dynamic data
      2. Property binding and responding to events
      3. Toggling templates dynamically
    7. Summary
  14. Chapter 5: Structure an Angular App
    1. Technical requirements
    2. Organizing components into modules
      1. Introducing Angular modules
      2. Creating your first module
      3. Registering components with a module
      4. Exposing module features
      5. Extending functionality with modules
    3. Configuring the application
      1. Configuring the workspace
      2. Developing the application
      3. Configuring the environment
    4. How dependency injection works in Angular
      1. Delegating complex tasks to services
      2. Providing dependencies across the application
      3. Injecting dependencies into the component tree
      4. Overriding providers in the injector hierarchy
    5. Summary
  15. Chapter 6: Enrich Components with Asynchronous Data Services
    1. Technical requirements
    2. Strategies for handling asynchronous information
      1. Shifting from callback hell to promises
      2. Observables in a nutshell
    3. Reactive functional programming in Angular
      1. The RxJS library
    4. Creating a backend API-the Angular way
    5. Communicating data over HTTP
      1. Introducing the Angular HTTP client
      2. Handling data with CRUD in Angular
    6. Authenticating with HTTP
    7. Handling HTTP errors
    8. Unsubscribing from observables
      1. Destroying a component
      2. Using the async pipe
    9. Summary
  16. Section 3: User Experience and Testability
  17. Chapter 7: Navigate through Components with Routing
    1. Technical requirements
    2. Introducing the Angular router
      1. Specifying a base path
      2. Importing the router module
      3. Configuring the router
      4. Rendering components
    3. Creating an Angular app with routing
      1. Scaffolding an Angular app with routing
      2. Adding route configuration to our Angular app
      3. Navigating to application routes
    4. Separating our app into feature routing modules
      1. Handling unknown route paths
      2. Setting a default path
      3. Navigating imperatively to a route
      4. Decorating router links with styling
    5. Passing parameters to routes
      1. Building a detail page using route parameters
      2. Reusing components using child routes
      3. Taking a snapshot of route parameters
      4. Filtering data using query parameters
    6. Enhancing navigation with advanced features
      1. Controlling route access
      2. Preventing navigation away from a route
      3. Preloading route data
      4. Lazy loading routes
      5. Debugging route configuration
    7. Summary
  18. Chapter 8: Orchestrating Validation Experiences in Forms
    1. Technical requirements
    2. Introducing forms to web apps
    3. Data binding with template-driven forms
    4. Using reactive patterns in Angular forms
      1. Turning a template-driven form into a reactive one
      2. Providing status feedback
      3. Creating nesting form hierarchies
    5. Validating controls in a reactive way
    6. Modifying forms dynamically
    7. Creating elegant reactive forms
    8. Building a custom validator
    9. Manipulating form data
    10. Watching state changes and being reactive
    11. Summary
  19. Chapter 9: Introduction to Angular Material
    1. Technical requirements
    2. Introducing Material Design
      1. Known implementations
    3. Introducing Angular Material
      1. Creating your first Angular Material app
      2. Adding Angular Material controls
      3. Theming Angular Material components
    4. Adding core UI controls
      1. Buttons
      2. Form controls
      3. Navigation
      4. Layout
      5. Popups and modals
      6. Data table
    5. Introducing the Angular CDK
      1. Clipboard
      2. Drag and drop
    6. Designing layouts using flexbox
    7. Summary
  20. Chapter 10: Giving Motion to Components with Animations
    1. Technical requirements
    2. Creating animations with plain vanilla CSS
    3. Introducing Angular animations
      1. Creating our first animation
      2. Animation callbacks
    4. Animating components programmatically
      1. Creating a reusable animation directive
    5. Summary
  21. Chapter 11: Unit test an Angular App
    1. Technical requirements
    2. Why do we need tests?
    3. The anatomy of a unit test
    4. Introducing unit tests in Angular
      1. Configuring Karma as the test runner
      2. Angular testing utilities
    5. Testing components
      1. Testing with dependencies
      2. Testing with inputs and outputs
    6. Testing services
      1. Testing a synchronous method
      2. Testing an asynchronous method
      3. Testing services with dependencies
    7. Testing pipes
    8. Testing routing
      1. Testing the navigation URL
      2. Testing route parameters
      3. Testing routes
    9. Testing directives
    10. Testing reactive forms
    11. Summary
  22. Section 4: Deployment and Practice
  23. Chapter 12: Bringing an Angular App to Production
    1. Technical requirements
    2. Building an Angular app
    3. Limiting the application bundle size
    4. Optimizing the application bundle
    5. Deploying an Angular app
    6. Summary
  24. Chapter 13: Develop a Real-World Angular App
    1. Technical requirements
    2. Scaffolding the application structure
    3. Implementing core features
      1. Persisting data using local storage
      2. Creating a header component
    4. Adding heroes functionality
      1. Adding a new hero
      2. Displaying a list of heroes
      3. Taking actions on a specific hero
    5. Integrating the missions module
      1. Assigning a new mission
      2. Marking a mission as completed
    6. Summary
  25. Other Books You May Enjoy
    1. Leave a review - let other readers know what you think
3.15.6.77