To bring it to a point in the simplest terms, I would say that pipe is for data management, and the directive more suitable for manipulating the DOM.
The pipe receives data as input, converts it, and displays this data in a different way.
The directive receives the DOM element, which it βattachesβ and improves it with some functions.
Of course, you will find examples in which both make sense (consider Components
, and you have three types of structures that need to be decided between them), and this depends more on the preference you choose.
In your example, you would use the handset. Suppose you want to display the currency value in bold and use the image icon as a currency symbol, which you probably accept the directive
source share