Unable to bind MD input defaut value to autocomplete
See original GitHub issueBug, feature request,
Unable to bind MD input defaut value to autocomplete
What is the expected behavior?
We have a service which returns the result for the inputs. Now iam using mdinput with autocomplete. I can see the results of the autocomplete popped up but not the default value which is assigned to md-input. Below is my code.
Below is the code ::
<md-input-container >
<input mdInput [mdAutocomplete]="primary" [(ngModel)]="primaryRoleDetails" (ngModelChange)="filterPrimaryRoles = filterRoles($event)" [formControl]="primaryRoleCtrl">
</md-input-container>
<md-autocomplete #primary="mdAutocomplete" class="addautoComplete" [displayWith]="displayRoles">
<md-option *ngFor="let roles of filterPrimaryRoles" [value]="roles" >
{{roles?.jobrolecode}}
</md-option>
</md-autocomplete>
Here primaryRoleDetails is the default value , filterPrimaryRoles is the list of values in the autocomplete.
Any idea on this please?
Iam using Angular 4 + Material Beta 3 version.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:13 (4 by maintainers)
Top Results From Across the Web
Unable to bind MD input defaut value to autocomplete #4451
Now iam using mdinput with autocomplete. I can see the results of the autocomplete popped up but not the default value which is...
Read more >To make default selection in autocomplete (material)
Use FormControl SetValue method to set Default Value this.myControl.setValue( {name: 'Mary'});.
Read more >Directives > mdAutocomplete - AngularJS Material
Parameter Type Description
md‑search‑text expression expression A model to bind the search query text to.
md‑selected‑item object object A model to bind the selected item...
Read more >Autocomplete displayValue and manually set value
Hi,. I'm using the mdbautocomplete with a server side search. When user selects something, i want to keep the UserSelected object, and write...
Read more >Form Input | Components - BootstrapVue
By default, range inputs "snap" to integer values. To change this, you can specify a step value. In the example below, we double...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Can be set or reset formControl as…
I think I had the same problem as you.
Here is my solution:
I create a template variable on the input field, and then in my controller: