Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Learning Angular

You're reading from   Learning Angular A no-nonsense beginner's guide to building web applications with Angular 10 and TypeScript

Arrow left icon
Product type Paperback
Published in Sep 2020
Publisher Packt
ISBN-13 9781839210662
Length 430 pages
Edition 3rd Edition
Languages
Tools
Arrow right icon
Authors (2):
Arrow left icon
Aristeidis Bampakos Aristeidis Bampakos
Author Profile Icon Aristeidis Bampakos
Aristeidis Bampakos
Pablo Deeleman Pablo Deeleman
Author Profile Icon Pablo Deeleman
Pablo Deeleman
Arrow right icon
View More author details
Toc

Table of Contents (19) Chapters Close

Preface 1. Section 1: Getting Started with Angular
2. Chapter 1: Building Your First Angular App FREE CHAPTER 3. Chapter 2: Introduction to TypeScript 4. Section 2: Components – the Basic Building Blocks of an Angular App
5. Chapter 3: Component Interaction and Inter-Communication 6. Chapter 4: Enhance Components with Pipes and Directives 7. Chapter 5: Structure an Angular App 8. Chapter 6: Enrich Components with Asynchronous Data Services 9. Section 3: User Experience and Testability
10. Chapter 7: Navigate through Components with Routing 11. Chapter 8: Orchestrating Validation Experiences in Forms 12. Chapter 9: Introduction to Angular Material 13. Chapter 10: Giving Motion to Components with Animations 14. Chapter 11: Unit test an Angular App 15. Section 4: Deployment and Practice
16. Chapter 12: Bringing an Angular App to Production 17. Chapter 13: Develop a Real-World Angular App 18. Other Books You May Enjoy

Building custom directives

Custom directives encompass a vast world of possibilities and use cases, and we would need an entire book to showcase all the intricacies and possibilities they offer. In a nutshell, they allow you to attach advanced behaviors to elements in the DOM or modify their appearance.

If a directive has a template attached, then it becomes a component. In other words, components are Angular directives with a view. This rule becomes handy when we want to decide whether we should create a component or a directive for our needs. If we need a template, we create a component; otherwise, make it a directive.

As we have already learned, directives fall into two categories: structural and attribute. In the following sections, we showcase how to create a directive of each category from scratch.

Displaying dynamic data

We have all found ourselves in a situation where we want to add copyright information to our applications. Ideally, we want to use this information...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime