I have the following json syntax:
{
"count": 90,
"results": [
{
"tra_keywords": [
"car",
"plane",
"Bike",
"boat"
],
"tra_title": "Jack"
},
{
"tra_keywords": [
"blue",
"red",
"green",
"silver"
],
"tra_title": "Averell"
},
{
"tra_keywords": [
"square",
"column",
"square",
"line"
"tra_title": "Joe"
}
]
}
I would like to display all my tra_keywords in a select. I use this:
<select class="form-control" id="rechercheKeywords" ng-model="rechercheKeywords" ng-options="resultats.tra_keywords for resultats in resultatsJSON.results"></select>
It works but my select display all my keywords in the field. Select display is:
first option: car,plane,Bike,boat
second option: blue,red,green,silver
... square,column,square,line
I would like to have this one by one. Select display i would like:
first option: car
second option: plane
... Bike
boat
blue
red
green
silver
square
column
line
How can i do that ? I think my ng-options is incorrect. Thanks
I receive my data with:
myApp.controller("myappCtrl", ['$scope','$http',function($scope,$http) {
$http.get('../testANGULAR/json/flux.json')
.success(function(data){
scope.resultatsJSON=data;
})....