In using https://material.angular.io/components/select/overview#multiple-selection
How to limit the number of items selected to N number? Where N is 3 or 4 or 5.
You can do this using the disabled property on the mat-option like so:
2 && !formGroup.get('myCtrl').value?.includes(o)" *ngFor="let o of itemList" [value]="o">{{o.name}}