Field disabled if condition is true

Asked

Viewed 38 times

1

I have a value editing and installments view... In this view I have 2 fields, 1 button and a list (where I can edit the line so that the status is paid):

In this list contains a status column, if there is at least one item with paid status, put disabled to the fields and button to prevent recalculation of these plots. If there is no paid status, allow recalculate the installments and/or change the value.

I created a property parcelasPagas in the component.ts with the value of false, I do the check to turn it into true if there are any.

I’m new with angular, I don’t know what to do. I tried with the ngIf however it serves to show and hide right, but the disabled could not do...

That’s what I tried:

<div class="card color-bordered-table info-bordered-table" *ngIf="!parcelasPagas">

1 answer

4


use the property disabel in the components by placing this property in the input

[disabled]="parcelasPagas"

Browser other questions tagged

You are not signed in. Login or sign up in order to post.