Skip to content
Advertisement

Angular, resetting input field back to a default value

In the following example i want to be able to reset input field to default value, (after user might have changed the input value manually)

the main problem is, that default value never changes, so re-setting it does nothing

Template

JavaScript

Component

JavaScript

Advertisement

Answer

You could use Template variable:

JavaScript

See StackBlitz example.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement