xEmptyCanx
xEmptyCanx

Reputation: 528

How to create drop down filter results in AngularJS

I've got an Angular app with a search bar at the top of a webpage. This search bar is a filter that displays subsets of a JSON data array. I'd like for this filter to display its results in a fashion that doesn't affect the DOM on the rest of the page (that way, if the filter returns a ton of results, a drop down box with its own scrolling option will appear, as opposed to the results pushing down the underlying HTML page).

The solution I came up with was to wrap my ng-repeat and filter in a div and give that div an absolute position in my CSS. Is there a better way to do this? This seems awfully hackish and not very Angular to me, but I can't find any other drop down filter solutions.

Upvotes: 4

Views: 17611

Answers (1)

EpokK
EpokK

Reputation: 38092

There is a working implementation in AngularStrap :

Upvotes: 5

Related Questions