Kathir
Kathir

Reputation: 6196

Angular Typeahead result in target div

Is it possible to put the angular ui typeahead results in a separate div on the page instead of the default. I have seen this SO post AngularJS typeahead search results in a div but wondering if anybody have already tried this.

Upvotes: 1

Views: 750

Answers (1)

hamed Ashrafi
hamed Ashrafi

Reputation: 41

Search for $document.find('body').append($popup); in the typeahead.js.

If the typeahead-append-to-body attribute that is by default set to False changes to True, the result will be append to the <body>

<input type="text" typeahead-append-to-body="true">

If you change the $document.find('body').append($popup); to something like $document.find('#myElement').append($popup); , the result will be append to the element with id #myElement.

You can define your attribute , something like typeahead-append-to-myElement

Upvotes: 3

Related Questions