#Input form

8 messages · Page 1 of 1 (latest)

signal hazel
#

I didn't understand what you're trying to do, but this.form.value will be a boolean value, then you cannot use it as argument of clickTwo(form: AllotmentTaskDTO)

signal hazel
#

Try this

return 
  !this.form.controls['title'].value && 
  !this.form.controls['partialAgreement'].value
#

And obviously, you want the button to be disabled when the function return true so

[disabled]="draftButtonDisabled()"
#

But I suggest to you to choose a reactive approach, leveraging status and value changes observables.

#

Nothing to do with my suggestions.
Now I have to go, but FYI, the right solution is to add a required validator to those two controls, and bind the disabled property of the button to the combination of their valid property.

#

If they are the only controls of their parent form

#

you can directly bind button's property to single valid property of the form.

signal hazel
#

If that works your setup has to be really weird.
I'd suggest you to look at my last message for the canonical solution to your needs.