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

how to change the font color of placeholder in md-chips?

Here's my code. I have a md-autocomplete and I want to change the font color of the placeholder of the chip.
0
votes
0 answers

Md-Autocomplete: How to update autocomplete textbox value based on the selection from dropdown?

I am able to achieve that by manually updating the model value which is bind to md-search-text, but that will trigger the autocomplete request again. Any inputs?
Kapil
  • 11
  • 3
0
votes
1 answer

How to click on md-autocomplete button "cross" by script?

I have md-autocomplete directive and try to search and click on the button clear(cross) when item is selected. What I do wrong ? var buttons = document.querySelector('md-autocomplete button'); buttons.onclick();
Maksim
  • 155
  • 1
  • 2
  • 17
0
votes
1 answer

How should I integrate auto complete code into my current AngularJS code in following scenario?

I'm a very newbie to AngularJS, so please try to understand my concerns. I already have an HTML page and a controller written for it as follows : bankDetails.html
0
votes
1 answer

Filtering an array of objects on 1 property not limited to start of text

I'm trying to combine lodash with ngMaterial and md-autocomplete. I have a collection of user objects in an array: var User.collection = [ { 'user': 'fred', 'age': 48 }, { 'user': 'barney', 'age': 34 }, { 'user': 'fred', 'age': 42 }, {…
Batman
  • 5,563
  • 18
  • 79
  • 155
0
votes
2 answers

Angular Material : chips md-autocomplete never hide suggestions menu

I want to have an input with autocomplete suggestions in a chrome extension. I face a very weird issue. Once I get the focus on my input, the suggestions menu is opened well with good values but then if I focus anywhere else, the suggestion menu…
0
votes
2 answers

Adding dynamically Angular Material mdAutocomplete

i have a long color list and i want to create a table for color selection. But when i repeat my table row with ng-repeat, all mdAutocompletes ran together and didn't work. here is what i've tried: codepen.io/anon/pen/avoMbg How can i fix this?
0
votes
1 answer

Angular Material form scrolls down on page load

I created a long form using Angular Material. Weird thing is that instead of the page displaying normally it starts off midway through the form. Is this something my browser is doing (Perhaps it thinks I left off at a certain point last time)? Not…
albertski
  • 2,428
  • 1
  • 25
  • 44
0
votes
3 answers

Angular.js autocomplete with $http.get TypeError: Cannot read property 'success' of undefined

With this code i always get TypeError: Cannot read property 'success' of undefined. I've tried also with .then instead of .success but i get the same error. After plus than ten hours of googling i'm a little bit desperate... Html:
0
votes
1 answer

Angular material design md-autocomplete with md-max-length and pattern

I'm using md-autocomplete directive as a address for zip code lookup. I want to limit what the user type in the control to five digit zip code only. It has to be numbers and limited to 5 numbers. How can I achieve this in md-autocomplete?
wonderful world
  • 10,969
  • 20
  • 97
  • 194
-1
votes
2 answers

User object to populate md-items in md-autocomplete

I want to populate my md-autocomplete with an object containing user objects. It's retrieved in JSON format through a factory into $scope.users. I can check the object in my console using an Angular viewer. users: user_id: display_name:…
Sjors Hijgenaar
  • 1,232
  • 1
  • 16
  • 30
1 2 3
8
9