This is my HTML code
<body ng-app="mainApp">
<div ng-controller="myController">
<select>
<option ng-repeat="person in persons">{{ person.data }}</option>
</select>
</div>
</body>
This is my JavaScript code
var app = angular.module("mainApp", []);
app.controller("myController", function($scope, $http) {
$http.get("JSON URL")
.success(function(response) {
$scope.persons = response.data;
});
});
My JSON URL is in this format [{"status": "success", "data": ["bank1","bank2","bank3"]}]
, I want only "data" list in drop down, there is too many banks in JSON data, How to use select and option?