Hi,
I am populating a table with various data. In the last column I want to
add a bootstrap button.
When I click the button I want the button color to change (and obviously
other things) however when I click the button all the other buttons in the
column change color.
How do I specify the specific button I clicked?
Presumably I can use the $event. i.e. if (event.target.id ==
"??????????????" ). Maybe I am just going about this all wrong?
Here is a sample of what I am trying to do.
//////////////Inside the Template:
<tr *ngFor="let object of objects">
<td>
...
</td>
<td class="action" align="center">
<button data-toggle="collapse"
(click)="toggleColor($event)"
class="btn btn-{{buttonType}} btn-xs">
</button>
</td>
</tr>
////////////Inside the Component
buttonType == 'success'
...
...
....
toggleColor(event) {
if (this.buttonType == 'success') {
this.buttonType = 'default';
} else {
this.buttonType = 'success'
}
}
It would be good if someone could help.
Rob S.
--
You received this message because you are subscribed to the Google Groups
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.