更改uib-typeahead的搜索结果视图

时间:2017-10-10 17:52:48

标签: angularjs angular-ui-bootstrap angular-ui-typeahead

我想要做的是与此类似,但我想在一个国家的所有城市都应该进入该州的标题。我只能使用Uib-typeahead。 请参阅下面的链接。

https://codepen.io/joe-watkins/pen/EagEWv

示例json就像

[
{
    "id": "1",
    "name": "Mumbai",
    "state": "Maharashtra"
},
{
    "id": "2",
    "name": "Delhi",
    "state": "Delhi"
},
{
    "id": "3",
    "name": "Bengaluru",
    "state": "Karnataka"
},
{
    "id": "4",
    "name": "Pune",
    "state": "Maharashtra"
},
{
    "id": "5",
    "name": "Nagpur",
    "state": "Maharashtra"
}
 ]

输出应该像

国家应该是大胆的

 **Maharashtra**         **Delhi**          **Karnataka**
 Pune                      Delhi              Bengaluru
 Mumbai
 Nagpur

0 个答案:

没有答案