UNPKG

ipsos-components

Version:

Material Design components for Angular

16 lines (14 loc) 560 B
<section> <h2>Filtering and selection</h2> <p>Select your favorite state</p> <mat-form-field> <input matInput placeholder="Search for a state" [matAutocomplete]="autocomplete" [(ngModel)]="value" (ngModelChange)="filteredStates = filter(value)"> <mat-autocomplete #autocomplete="matAutocomplete"> <mat-option *ngFor="let state of filteredStates" [value]="state.name"> <span>{{ state.name }}</span> </mat-option> </mat-autocomplete> </mat-form-field> <p>Selected value: {{ value }}</p> </section>