Questions tagged [md-autocomplete]

is a special input component with a drop-down of all possible matches to a custom query. This component allows you to provide real-time suggestions as the user types in the input area.

docs

https://material.angularjs.org/latest/api/directive/mdAutocomplete

demo

https://material.angularjs.org/latest/demo/autocomplete

syntax

<md-autocomplete
    md-selected-item="selectedItem"
    md-search-text="searchText"
    md-items="item in getMatches(searchText)"
    md-item-text="item.display">
   <span md-highlight-text="searchText">{{item.display}}</span>
</md-autocomplete>

screenshot

enter image description here

131 questions
0
votes
1 answer

angular 2 md-options weird UI behavior with md-autocomplete

following the guide from https://material.angular.io/components/autocomplete I tried to implement autocomplete feature in my app, which needs to fetch autocomplete suggestions from a back end service, all the logic is working fine.But I am…
FreakAtNs
  • 135
  • 1
  • 9
0
votes
0 answers

md-autocomplete select by object value

Do you guys know of a way to have md-autocomplete select based on the value of one object parameter? I want to preselect some data in my autocompletes on loading of my data. So for instance the data I get from my server is: {"building": "0015",…
0
votes
0 answers

Angular2 md-autocomplete persisting previously selected value

I am using Angular2 and have an within an which is populated with values from The scenario:- User selects a value from the autocomplete, it is displayed in the input box correctly. User then clears the selection by pressing backspace leaving…
Ram
  • 527
  • 1
  • 10
  • 26
0
votes
1 answer

Material 2 - autocomplete not showing options

I am trying to implement md-autocomplete of material-2 in angular. The way its suppose to work is when the user starts typing it would make an http call to get the data and will display in options. I am able to make the http calls but for some…
Bhavik Patel
  • 1,044
  • 1
  • 15
  • 33
0
votes
1 answer

Angularjs md-autocomplete with profile pictures

I have a search bar in the top my page for searching profiles. I would like to have an autocompletion feature like in facebook or linkedin. I'm using angularjs in the front. I need to show records of the found profiles with their images alongside…
Shimon Topach
  • 141
  • 10
0
votes
1 answer

Anuglar Material2 Autocomplete: bind to click in template

im trying to implement an angular(4) material2 autocomplete where the user can add an item via a dialog if there is no result. Therefore i tried to add a link to the autocomplete template like this:
fstrelczuk
  • 11
  • 1
  • 3
0
votes
1 answer

md-autocomplete dropdown not updating simultaneously with the md-search-text-change call

I show a dropdown using md-autocomplete, and also I have typeahead APIs which should get called once I start typing in the input box. The problem is that, it is calling the typeahead API and fetching the results and setting it to a variable in JS…
tanmayghosh2507
  • 773
  • 3
  • 12
  • 31
0
votes
2 answers

md-autocomplete md-clear-button="true" does not show the clear button

I have the issue with component which is shown in this demo: does not work. I would expect that a cross is shown at the end of the input field, like it is shown for official Basic Usage…
dma_k
  • 10,431
  • 16
  • 76
  • 128
0
votes
1 answer

Angular Material's FormControl causes error in *ngFor

I want to use the MdAutocomplete Component of Angular Material2 in a *ngFor which repeats a component. But I get the following error: ERROR Error: Cannot find a differ supporting object '[object Object]' of type 'object'. NgFor only supports binding…
Roman
  • 3,011
  • 2
  • 20
  • 30
0
votes
1 answer

md-autocomplete with webapi call showing previous results

So i'm trying to autocomplete by calling a webapi, and it's working/returning the correct data but the md-autocomplete is always showing the results from the previous webapi call, not the most recent one. So when the user enters two characters, the…
user4523
  • 115
  • 7
0
votes
1 answer

md-autocomplete giving error on .then function

I am not able to use angularjs md-autocomplete directive. Please let me know where is the issue. TypeError: Cannot read property 'then' of undefined at de (angular-material.min.js:13) at he (angular-material.min.js:13) at e.B [as focus]…
n3018
  • 121
  • 2
  • 10
0
votes
3 answers

Displaying array in single string with comma angularjs

I need to represent Given array : ["Alabama", "Alaska", "Arizona", "Arkansas", "California", "Colorado"] as single string separated by commas: 'Alabama, Alaska, Arizona, Arkansas, California, Colorado'
n3018
  • 121
  • 2
  • 10
0
votes
1 answer

md-chips and md-autocomplete input field

When user enters an input with md-chips and the focus is removed the entry is still there. is there a way to delete any entry that is not a chip once the focus is removed? The Out Standing Text still shows once the focus is removed
Flash
  • 924
  • 3
  • 22
  • 44
0
votes
1 answer

md autocomplete shows no results when input is empty

I am using a md-autocomplete element, but there is no dropdown when the search field is empty. It doesn't even call the querySearch function. When I type anything the function is triggered and the autocomplete works. What am I doing wrong? The…
0
votes
1 answer

md-autocomplete with errors works the first time only

In angular material demo, when I test the autocomplete floating label example, it doesn't work correctly with errors https://material.angularjs.org/latest/demo/autocomplete Click on "favorite state" and click out > error message is displayed :…
pop_up
  • 1,451
  • 2
  • 18
  • 35
1 2 3
8 9