Answer the question
In order to leave comments, you need to log in
How to mark all pressed buttons?
Good afternoon. Morning goof.
There is a "form" on which the user must mark the required colors
<button md-button md-raised-button
*ngFor="#color of colors"
[class.selected]="color === selectedColors"
(click)="onSelect(color)">
{{color.name}}
</button>
//When click on color
onSelect(color: Color) {
// choosen color
this.selectedColors = color;
// if exist push color's id in array
if (this.selectedColors) {
this.colorsArray.push(this.selectedColors.id);
}
}
Answer the question
In order to leave comments, you need to log in
at htmlacademy, I remember the lesson was like this, but I forgot))
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question