Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Angular Cookbook
Angular Cookbook

Angular Cookbook: Over 80 actionable recipes every Angular developer should know

eBook
€8.99 €23.99
Paperback
€29.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

Angular Cookbook

Chapter 2: Understanding and Using Angular Directives

In this chapter, you'll learn about Angular directives in depth. You'll learn about attribute directives, with a really good real-world example of using a highlight directive. You'll also write your first structural directive and see how ViewContainer and TemplateRef services work together to add/remove elements from the Document Object Model (DOM), just as in the case of *ngIf, and you'll create some really cool attribute directives that do different tasks. Finally, you'll learn how to use multiple structural directives on the same HyperText Markup Language (HTML) element and how to enhance template type checking for your custom directives.

Here are the recipes we're going to cover in this chapter:

  • Using attribute directives to handle the appearance of elements
  • Creating a directive to calculate the read time for articles
  • Creating a basic directive that allows you to vertically scroll to an element
  • Writing your first custom structural directive
  • How to use *ngIf and *ngSwitch together
  • Enhancing template type checking for your custom directives

Technical requirements

For the recipes in this chapter, make sure you have Git and Node.js installed on your machine. You also need to have the @angular/cli package installed, which you can do with npm install -g @angular/cli from your terminal. The code for this chapter can be found at https://github.com/PacktPublishing/Angular-Cookbook/tree/master/chapter02.

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Explore recipes across core Angular topics to fill gaps in your knowledge of using Angular in production
  • Discover industry best practices and tooling to enhance your development experience with Angular
  • Understand advanced topics in Angular to help you become a proficient enterprise web developer

Description

The Angular framework, powered by Google, is the framework of choice for many web development projects built across varying scales. It’s known to provide much-needed stability and a rich tooling ecosystem for building production-ready web and mobile apps. This recipe-based guide enables you to learn Angular concepts in depth using a step-by-step approach. You’ll explore a wide range of recipes across key tasks in web development that will help you build high-performance apps. The book starts by taking you through core Angular concepts such as Angular components, directives, and services to get you ready for building frontend web apps. You’ll develop web components with Angular and go on to cover advanced concepts such as dynamic components loading and state management with NgRx for achieving real-time performance. Later chapters will focus on recipes for effectively testing your Angular apps to make them fail-safe, before progressing to techniques for optimizing your app’s performance. Finally, you’ll create Progressive Web Apps (PWA) with Angular to provide an intuitive experience for users. By the end of this Angular book, you’ll be able to create full-fledged, professional-looking Angular apps and have the skills you need for frontend development, which are crucial for an enterprise Angular developer.

Who is this book for?

The book is for intermediate-level Angular web developers looking for actionable solutions to common problems in Angular enterprise development. Mobile developers using Angular technologies will also find this book useful. Working experience with JavaScript and TypeScript is necessary to understand the topics covered in this book more effectively.

What you will learn

  • Gain a better understanding of how components, services, and directives work in Angular
  • Understand how to create Progressive Web Apps using Angular from scratch
  • Build rich animations and add them to your Angular apps
  • Manage your app's data reactivity using RxJS
  • Implement state management for your Angular apps with NgRx
  • Optimize the performance of your new and existing web apps
  • Write fail-safe unit tests and end-to-end tests for your web apps using Jest and Cypress
  • Get familiar with Angular CDK components for designing effective Angular components

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Aug 06, 2021
Length: 652 pages
Edition : 1st
Language : English
ISBN-13 : 9781838981358
Vendor :
Google
Languages :
Tools :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Aug 06, 2021
Length: 652 pages
Edition : 1st
Language : English
ISBN-13 : 9781838981358
Vendor :
Google
Languages :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 95.97
TypeScript 4 Design Patterns and Best Practices
€27.99
Angular Cookbook
€29.99
Angular Projects
€37.99
Total 95.97 Stars icon
Banner background image

Table of Contents

14 Chapters
Chapter 1: Winning Components Communication Chevron down icon Chevron up icon
Chapter 2: Understanding and Using Angular Directives Chevron down icon Chevron up icon
Chapter 3: The Magic of Dependency Injection in Angular Chevron down icon Chevron up icon
Chapter 4: Understanding Angular Animations Chevron down icon Chevron up icon
Chapter 5: Angular and RxJS – Awesomeness Combined Chevron down icon Chevron up icon
Chapter 6: Reactive State Management with NgRx Chevron down icon Chevron up icon
Chapter 7: Understanding Angular Navigation and Routing Chevron down icon Chevron up icon
Chapter 8: Mastering Angular Forms Chevron down icon Chevron up icon
Chapter 9: Angular and the Angular CDK Chevron down icon Chevron up icon
Chapter 10: Writing Unit Tests in Angular with Jest Chevron down icon Chevron up icon
Chapter 11: E2E Tests in Angular with Cypress Chevron down icon Chevron up icon
Chapter 12: Performance Optimization in Angular Chevron down icon Chevron up icon
Chapter 13: Building PWAs with Angular Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.4
(14 Ratings)
5 star 64.3%
4 star 7.1%
3 star 28.6%
2 star 0%
1 star 0%
Filter icon Filter
Top Reviews

Filter reviews by




Neakjie Oct 20, 2021
Full star icon Full star icon Full star icon Full star icon Full star icon 5
It’s very useful for enterprise level SPA development.
Amazon Verified review Amazon
Ria Jul 17, 2022
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Wish I bought this book sooner. Right away clarifies in succinct language / effective examples mechanisms like observables and how to properly access child components.
Amazon Verified review Amazon
Pranam Bhat Sep 14, 2021
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Angular Cookbook comes up with a lot of updates and new feature's. For example, Angular Materials, State Change, etc, etc. All these core concepts explained really well. The interesting feature about this book is - It has given enough examples and elaborates each topic with it's usage. One must read this book to get hands on real world usage of core concepts of Angular.Author has core knowledge on Angular concepts and he's also a Google Developer Expert.I recommend this book to all the Angular freaks over there.
Amazon Verified review Amazon
Sahil Sep 15, 2021
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Just finished reading this book. It is nicely curated and it has recipes which will help you to understand different concepts about Angular and level your self up really fast!
Amazon Verified review Amazon
Samuel Stegall Aug 31, 2021
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Angular Cookbook is a great resource for new and experienced Angular Developers alike. What the book excels at is showing common patterns and boilerplate for intermediate and complex topics. This is the sort of book that I would turn to if I need to implement something complex that I have not implemented before, or if I need to look at a code sample for something that I do infrequently.My favorite section in the Angular Cookbook is its section on animations. Animations are a great way to provide reactivity and fluidity to a web app, but they can be somewhat daunting to write for newer Angular developers. The Angular Cookbook provides code samples for animating components, but takes it one step further by explaining how a given code sample works and what the sample is doing. Providing extra context like this is critical for newer developers to learn and fully understand what they're doing.The only thing I could see that might be improved in this book is that there are unnecessary references to VS Code in several of the Getting Started sections. This isn't a major issue: using any IDE is fine. However, since the book doesn't use any plugins, snippets, or VS Code-specific features, I don't see much of a reason why VS Code would be mentioned explicitly. A newer developer may get a bit confused by this and go out of their way to install additional software that may not be necessary if they already have an editor of choice.Overall, this is a stellar book that all Angular developers would benefit from having on their bookshelves.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.