vendredi 6 août 2021

Changing the state of a property with a if function

i try to change the Value of a Property. I dont know what im doing wrong.. Im kinda new to this.

The property Disabled disables a form field in my Angular App.

I want the disabled property to false true as soon as the cityFilter property has a string in it. And if cityFilter is empty i want it to turn true

cityFilter = '';
cityFilterNull = '';
disabled = true;

disableCircleFilter() {
    if(this.cityFilter === this.cityFilterNull) {
      return this.disabled = true;
    }
    else {
      return this.disabled = false;
    }
  }

Thanks for your Help

Greetings

Aucun commentaire:

Enregistrer un commentaire