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.
In this example we will use an external library that, by itself, is already a component, a very powerful charts library called
Beyond it, we will use another library called
c3.js. In an instant, you will understand...