How should I make the button inactive? It should only be active when a complete city name has been selected from the dropdown of the typeahead e.g. "Alabama" and the button should be inactive in case something is typed, but is not a complete name from the list e.g."Alab"
How to know whether an item from the dropdown has been selected in angular ui typeahead?
Here I've disabled the button if the
selected value is not in the array of states. I know that if the array is large this could be a performance hit.
jQuery has a function
or Underscore has a