Datepicker clear on form reset


Topic: Datepicker clear on form reset

Arturo Macías pro asked 4 years ago

Hi all, i'm using Angular datepicker in a form. When form is submitted,  i reset the form and all fields return to initial state except datepicker. I have looked at datepicker.component.ts and there is a datepicker method called clearDate but i don't know how to invoke it when form is submitted. Any Idea? thanks!

Dawid Adach pro answered 4 years ago

Dear Arturo, you can access component method using ViewChild, please check following question where you will find similar exmaple https://mdbootstrap.com/support/howto-programmatically-set-the-date-in-datepicker/
Status

Closed

Specification of the issue
  • User: Pro
  • Premium support: No
  • Technology: Angular
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No