vibhor
vibhor

Reputation: 31

Autocomplete words in angular

I want a solution where in my textarea, I can write the text with autocomplete feature. The solution should be similar to writing in an editor, where I can go back and add new word if I want and it should suggest autocomplete for that too.

I have tried few examples, but none seem to be working for my problem. The closest example I got is https://bl.ocks.org/wheresjames/9643ce9d0a83ef30b36fc16d5a18e0ac

But this solution has few problems. For instance: 1. Its not working with ng-model 2. Clicking outside the box seems to change the value of textbox to last selected autocomplete.

Please suggest.

Upvotes: 1

Views: 1914

Answers (2)

Kyle Krzeski
Kyle Krzeski

Reputation: 6527

I've been using mdAutocomplete and it works great!

mdAutocomplete 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.

Documentation

DEMO

Upvotes: 1

jspurim
jspurim

Reputation: 955

Have you considered using CodeMirror? It has support for autocompletion, integration with angularjs and plugins to support your own dictionary.

Upvotes: 0

Related Questions