我一直在努力解决这个问题,它似乎“很简单”,但始终无法掌握。
我从维基百科获取了一个返回JSON的$http.get请求,格式如下:
[[
"Foobar",
"Foobar2000",
"Foobar (disambiguation)",
"Foxbar",
"Foodarama",
"Fobar",
"Foodar",
"Foxbar railway station",
"Fox Barrel",
"Fox baronets"
],
[
"The terms foobar (/ˈfuːbɑːr/), fubar, or foo, bar, baz and qux (alternatively, quux) and sometimes norf and many others are sometimes used as placeholder names (also referred to as metasyntactic variables) in computer programming or computer-related documentation.",
"foobar2000 is a freeware audio player for Microsoft Windows developed by Piotr Pawlowski, a former freelance contractor for Nullsoft.",
"",
"Foxbar is an area of Paisley, bordered by the Gleniffer Braes and Paisley town centre. Consisting mostly of residential areas, Foxbar has rapidly grown over the past century to be one of the largest housing areas in the town.",
"Foodarama, also known as Cox's Foodarama, is a supermarket chain in Texas, with its headquarters in Foodarama Store #1 in Brays Oaks, Houston.",
"Fobar is a Malagasy football club based in Toliara, Madagascar.",
"",
"",
"Fox Barrel is a brand of perry (marketed as \"pear cider\") made in Colfax, CA.",
"The Fox Baronetcy, of Liverpool in the County Palatine of Lancaster, was a title in the Baronetage of the United Kingdom."
],
[
"https://en.wikipedia.org/wiki/Foobar",
"https://en.wikipedia.org/wiki/Foobar2000",
"https://en.wikipedia.org/wiki/Foobar_(disambiguation)",
"https://en.wikipedia.org/wiki/Foxbar",
"https://en.wikipedia.org/wiki/Foodarama",
"https://en.wikipedia.org/wiki/Fobar",
"https://en.wikipedia.org/wiki/Foodar",
"https://en.wikipedia.org/wiki/Foxbar_railway_station",
"https://en.wikipedia.org/wiki/Fox_Barrel",
"https://en.wikipedia.org/wiki/Fox_baronets"
]]
我遇到的问题是我的ng-repeat,目前是这样的:
<div ng-repeat="array in wikiSearch">
<div ng-repeat="x in array">
{{x}}
</div>
</div>