An important observation when we talk about directives and interface components is to understand that this is just an analogy between them, since the following doubt may arise: are not they the same thing? Not exactly.
The component is a code snippet that can be connected to any code block and still behave as expected. Even in different code blocks.
A directive often receives or handles data from external sources, so for it to behave the same way, interacting with different data sources needs some adjustments.
Here, we will see a way to create a directive and encapsulate its contents to get the same result.
Just as we did in the previous chapters, we will continue using the same application ...