Reputation: 721
For instance, let's consider the following scenario:
(ngModel)
between model
and input
field in the view. Pipe
used to show model
's milliseconds value as seconds in the input field. Can I have a Pipe
( or something similar ) that transforms back the seconds into milliseconds ? A Pipe
or something similar meaning NOT writing manually " on value change " handler methods in the component for each inputs
Upvotes: 0
Views: 1118
Reputation:
Short answer, no.
If you want to convert your milliseconds to seconds from the model to the input, then yes, you can use a pipe. But if the user can change it, you will have to let go of the pipe, since pipes are used just to display values, and not to edit them.
Upvotes: 2