How to add clear button in ionic

I want to make a form,which has a clear button,
and clicking on that button clears all the values of input box and radio buttons,
please help me with this,how to make a clear function which makes the textboxes empty and radiobuttons unchecked.

You should create a form with the formbuilder (docs over here ). Then you can clear the entire form by calling formgroup.reset();

1 Like

will this work for ionic2 too?

I have created the form:

now how should i add clear button function()?

Please help me in this…

this is my button code:

I don’t see a formgroup anywhere? Please do not use screenshots unless absolutely necessary, use code formatted with the </> button on the editor here. It’s a lot easier to read for everyone (screen readers, even for blind people ;)). Please read the part over here

about forms with formbuilders and ionic2

1 Like

Thanks ,I will definitely refer this.