bootstrap icon indicating copy to clipboard operation
bootstrap copied to clipboard

Nested results in typeahead

Open AlexCppns opened this issue 12 years ago • 6 comments

I need typeahead to show nested results (2 ng-repeats) with a custom template. Is there some way to do it?

AlexCppns avatar Mar 05 '14 17:03 AlexCppns

Not sure I got you here? Could you elaborate?

pkozlowski-opensource avatar Mar 05 '14 18:03 pkozlowski-opensource

The idea is to group the suggestions into sections. My array is 2dimensional so I cant just do

typeahead="content.string for content in contents"

I need to do something like

typeahead="content.string for content in content_type.contents for content_type in contents_types"

With my custom template being for content_type (and not content).

Here is a concret example: screen shot 2014-03-05 at 11 12 31 am

AlexCppns avatar Mar 05 '14 18:03 AlexCppns

I think what you are looking for is a groupBy option which typeahead does not suport - you could try: https://github.com/angular-ui/ui-select

Grigorius avatar Sep 24 '14 07:09 Grigorius

@Grigorius it's ok, I built my own module XD

AlexCppns avatar Sep 24 '14 08:09 AlexCppns

+1 for the groupBy option. @AlexCppns did you implement a version that support groupBy ?

jmaynier avatar Oct 20 '14 21:10 jmaynier

One could implement this via overriding of the typeahead-popup template and creating a custom set of directives.

Otherwise, this is a little complex of a feature for this library to have baked in & not something likely to be used widely, thus we would not want to support this in the library itself, but allow users to extend it to support this.

wesleycho avatar Nov 10 '15 08:11 wesleycho