I am creating a Toolbar with a selection list (checkboxes with each list item) using Angular Material 2. I just cannot figure out how to set the checkboxes before the list is displayed and then get the selected items following user interaction.
I am trying the control within a Form thinking I may need this to bind to ngModel, but this doesn't seem to help. My html so far is:
<form
novalidate
#areaSelectForm="ngForm">
<div>
<mat-selection-list
#areasList="ngModel"
[(ngModel)]="model"
id="areaListControl"
name="areaListControl"
(ngModelChange)="onAreaListControlChanged($event)">
<mat-list-option *ngFor="let tta of taskTypeAreas" (click)="onCheckboxClick($event)" [value]="tta">
{{tta}}
</mat-list-option>
</mat-selection-list>
</div>
</form>
This must be a well trodden path but the documentation is difficult to interpret and I cannot seem to find any suitable examples.
Any guidance very welcome please.