Quantcast
Channel: Ionic Forum - Latest posts
Viewing all articles
Browse latest Browse all 228595

How to disable a button on a condition?

$
0
0

Here's something that worked for me for dynamically disabling a button. In the HTML, put

<button disabled={{buttonDisabled}}>

and in your code, put

this.buttonDisabled = true;

to disable, or

this.buttonDisabled = null;

to enable.

(No idea why 'this.buttonDisabled = false;' does not enable the button but only '= null' does).

This works well for me.

But if you see a more correct way, to dynamically enable/disable a button via code, please mention it here.


Viewing all articles
Browse latest Browse all 228595

Trending Articles