Используйте директиву ngModel, затем поместите шаблон ref во входные данные и назначьте директиву ngModel и используйте этот шаблон ref для динамического связывания класса
<table class="table table-striped" [ngClass]="{'table-dark': ref.value == true}">
<thead class="thead-light">
<tr>
<th scope="col">1</th>
<th scope="col">2</th>
<th scope="col">3</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
</tr>
</tbody>
</table>
<div class="custom-control custom-switch">
<input type="checkbox" class="custom-control-input" #ref="ngModel" ngModel id="customSwitch" name="chec">
<label class="custom-control-label" for="customSwitch">Toggle Dark Mode</label>
</div>
https://stackblitz.com/edit/angular-nkthpk
Для получения дополнительной информацииоб угловой форме: https://angular.io/guide/forms