Skip to content
This repository has been archived by the owner on May 16, 2024. It is now read-only.

Clear model data #21

Open
pedalpete opened this issue May 5, 2016 · 1 comment
Open

Clear model data #21

pedalpete opened this issue May 5, 2016 · 1 comment

Comments

@pedalpete
Copy link

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?

@christrotter89
Copy link

@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)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants