My component has an @Input that I want to use to create an input and checkbox.
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
@Component({
selector: 'app-aside',
templateUrl: './aside.component.html',
styleUrls: ['./aside.component.css']
})
export class AsideComponent implements OnInit {
@Input() Segmenty;
@Output() checkedSegment : EventEmitter<string[]> = new EventEmitter();
constructor() {
}
ngOnInit(): void {
}
}
Current html structure :
<div *ngFor ="let segment of Segmenty" >
<input type="checkbox" checked="checked" > {{segment}}
<button (click)="allclickedSegment()"></button>
</div>
I need help creating the HTML and a method that will add all selected checkboxes into an array and emit it through the @Output property.
The array should contain only the letters:
'A', 'B', 'C', 'D', 'E', 'F', 'G'