Angular – Material: Progressbar custom color?

You can use ::ng-deep selector to achieve what you want, this answer has some info on it. How I did it: CSS ::ng-deep .mat-progress-bar-fill::after { background-color: #1E457C; } ::ng-deep .mat-progress-bar-buffer { background: #E4E8EB; } ::ng-deep .mat-progress-bar { border-radius: 2px; } HTML <mat-progress-bar mode=”determinate” value=”{{progress}}”></mat-progress-bar> And the result is this: EDIT: I found a way to … Read more

Angular Material: How to validate Autocomplete against suggested options?

For those who may need a similar approach. Here’s my solution. I’ve built a custom validation rule according to my needs. SELECTBOX_VALUE: [ null, Validators.compose([ Validators.required, FormCustomValidators.valueSelected(this.myArray), ]), ]; export class FormCustomValidators { static valueSelected(myArray: any[]): ValidatorFn { return (c: AbstractControl): { [key: string]: boolean } | null => { let selectboxValue = c.value; let … Read more

Is there a way to make a multiselection in Autocomplete (Angular4+)?

Angular Material documentation for chips includes a nice example of how to get started with a multiple selection autocomplete: <mat-form-field class=”example-chip-list”> <mat-chip-list #chipList> <mat-chip *ngFor=”let fruit of fruits” [selectable]=”selectable” [removable]=”removable” (removed)=”remove(fruit)”> {{fruit}} <mat-icon matChipRemove *ngIf=”removable”>cancel</mat-icon> </mat-chip> <input placeholder=”New fruit…” #fruitInput [formControl]=”fruitCtrl” [matAutocomplete]=”auto” [matChipInputFor]=”chipList” [matChipInputSeparatorKeyCodes]=”separatorKeysCodes” [matChipInputAddOnBlur]=”addOnBlur” (matChipInputTokenEnd)=”add($event)”> </mat-chip-list> <mat-autocomplete #auto=”matAutocomplete” (optionSelected)=”selected($event)”> <mat-option *ngFor=”let fruit of filteredFruits … Read more