pikaday-angular
pikaday-angular copied to clipboard
Clear model data
Great little directive, but I'm having trouble clearing the date field (I'll admit, I've been away from Angular for a bit, but thought this would be easy).
<input pikaday="filterCtrl.filter.fromDate" on-select="filterCtrl.selectDate(pikaday,'fromDate')" />
I thought pikaday would clear if I set filterCtrl.filter.fromDate = null
but the text is still in the input field.
I don't see anywhere in your code to clear. Is this possible? Or do I need to just go get the element and clear it?
@pedalpete You need to use the setDate method with a value of null. That will reset the pikaday date and input field value.
filterCtrl.filter.setDate(null)