What are the arguments for creating and using directives vs creating and using pipes.
The scenario this question stems from is around currency input and output.
If a user needs to input a currency, why not create/use a directive that parses the input into a formatted currency string? The other option is to take in that string, and display it through a pipe like so:
<input type="text" #val (keydown)="currencyVal=val.value" />
<h3>{{currencyVal | currency}}</h3>
vs
// Where mask-money is a directive that filters the
//input to a formatted currency string
<input type ="text" mask-money (keydown)="currencyVal=val.value" />
<h3>{{currencyVal}}</h3>
On the other hand, a pipe can be used in the controller/component triggered by an input to filter the value.
I could ask a ton of questions about it, but I basically want to know: what are the arguments for each?