Answer the question
In order to leave comments, you need to log in
How to change the value of a property in an iterable object?
Hello, I'm looping through an array and displaying objects from there. How to bind to the buttons increase / decrease the value ( item.count
) of the corresponding property of the object.
Code example:
<div *ngFor="let item of items">
<p>{{item.name}}</p>
<p>{{item.count}}</p>
<button>increment</button> // увеличить item.count
<button>decrement</button> // уменьшить item.count
</div>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question