How to make make single checkbox select from mat-selection-list. Similar to radio button which accepts one value from group of values.
Components >= 9.1.0
Selection list now supports a single selection mode directly. Enable it with the multiple input set to false.
...
Components < 9.1.0
You have to set SelectionModel for selectedOptions property of component reference on init.
@ViewChild(MatSelectionList, {static: true})
private selectionList: MatSelectionList;
ngOnInit() {
this.selectionList.selectedOptions = new SelectionModel(false);
}
MatSelectionList api
This way you can define initially selected values too.
export declare class SelectionModel {
constructor(_multiple?: boolean, initiallySelectedValues?: T[], _emitChanges?: boolean);
}
GitHub api