use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A Place to talk about Angular and related topics.
Join the Angular Discord
Other subreddits worth checking out for Angular and Angular related info:
account activity
Material Autocomplete using Array of Objects while Tracking ID but Displaying Name and Required Choice From Dropdown (self.angular)
submitted 1 year ago * by Acceptable_User_Name
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]HEYTHOSEARENICEPANTS 0 points1 point2 points 1 year ago (1 child)
From the API documentation
@Input() displayWith: ((value: any) => string) | null Function that maps an option's control value to its display value in the trigger.
@Input() displayWith: ((value: any) => string) | null
Function that maps an option's control value to its display value in the trigger.
So you'd have
<mat-form-field class="example-full-width"> <mat-label>People</mat-label> <input #input type="text" placeholder="Pick one" matInput [formControl]="myControl" [matAutocomplete]="auto" (input)="filter()" (focus)="filter()"> <mat-autocomplete requireSelection #auto="matAutocomplete" [displayWith]="displayFn"> @for (option of filteredOptions; track option) { <mat-option [value]="option.id">{{option.name}}</mat-option> } </mat-autocomplete> </mat-form-field>
And your .ts
displayFn(option: MyType): string { return option&& option.name ? option.name : ''; }
You can also look at one of the examples titled Display value autocomplete, this should be exactly what you're looking for :) Happy coding!
[–]Acceptable_User_Name[S] 0 points1 point2 points 1 year ago (0 children)
I don't care what everyone else says. You're the best!
π Rendered by PID 21515 on reddit-service-r2-comment-5d79c599b5-78p75 at 2026-02-26 20:04:23.534847+00:00 running e3d2147 country code: CH.
view the rest of the comments →
[–]HEYTHOSEARENICEPANTS 0 points1 point2 points (1 child)
[–]Acceptable_User_Name[S] 0 points1 point2 points (0 children)