I am facing an issue with my function that is supposed to console.log
the selected object from a checkbox. However, when I select only one checkbox, it logs everything instead of returning just the value from the checkbox.
Here is the relevant HTML code:
<ng-container *ngIf="(world$ | async) as world">
<div class="language" *ngFor="let language of world.languages">
<mat-checkbox [checked]="get(language)">{{language.label}}</mat-checkbox>
</div>
</ng-container>
And this is the Component snippet:
world$: Observable<World>;
get(e) {
console.log(e);
}
You can check out the data from Firebase (world$) for more context. My question is, how can I retrieve only the object assigned to the checkbox?
- [x] English <--- When checking this checkbox it should only console.log "English"
- [ ] French