I Want to hide and show the input field by clicking a button. can anyone please tell me how to do.
My code follows:
<button ion-button full round >Click </button>
Need to Hide
<ion-input type="text" value=""></ion-input>
Thanks in advance
I Want to hide and show the input field by clicking a button. can anyone please tell me how to do.
My code follows:
<button ion-button full round >Click </button>
Need to Hide
<ion-input type="text" value=""></ion-input>
Thanks in advance
use ngIf to show and hide a content
in your .html
in your .ts file
You could use a variable in your code behind and an
*ngIf
your.component.html
your.component.ts
Here's a plunker example https://plnkr.co/edit/Ot0b9iSc3vHWIDdwhhpw?p=preview
Hope that helps
-- Edit - Updated Plunk with animated example
Animated button clicks are can be done but they are slightly different, you have to use angular's built-in animation which is put within the component itself. It also requires additional imports within the component to use it.
Within the Component set up, you put an animation tag along with you selector, template etc and you can apply the style changes to that based on the string.
This is then applied to something within the components HTML with a tag like follows.
Here's the plunker example again https://plnkr.co/edit/Ot0b9iSc3vHWIDdwhhpw?p=preview
Hope that helps some more