Within my HTML form, there is a field labeled value. Alongside this field, there is an add button. When I click the add button, it duplicates the form field. My code is set up so that when I input a value (let's say 40) into the form field, then click the add button and input another value (like 50), a function calculates the sum of these values and compares it to the Totalvalue displayed above. If the sum exceeds the totalvalue, an error message appears.
Now, what I am trying to achieve is disabling the add button and enabling the submit button when the sum of the form values matches the totalvalue above. I attempted using [disabled]="isin"
with a boolean to toggle between disable and enable. However, this approach did not work as intended (as pressing backspace after exceeding the total value kept the add button disabled).
Please provide feedback below if my question was unclear or needs further clarification.
You can view my project on StackBlitz here: https://stackblitz.com/edit/angular-ivy-fc8tcl?file=src%2Fapp%2Fapp.component.html