mat selection code example

Example 1: mat selection list form control

// component.ts
this.clientForm = this.fb.group( {
    myOtherControl: new FormControl([]) 
});

// component.html
<form [formGroup]="clientForm">
   <pre>
     {{ clientForm.get('myOtherControl').value | json }}
   </pre>

   <mat-selection-list formControlName="myOtherControl">
     <mat-list-option value="SOMETHING3">SOMETHING3</mat-list-option>
     <mat-list-option value="SOMETHING4">SOMETHING4</mat-list-option>
   </mat-selection-list>
</form>

Example 2: MatListModule

Header set Access-Control-Allow-Origin 'origin-list'

Tags:

Misc Example