Hi ya'll I am trying to take this data that is returned from an api:
[{"Language":{"Id":1,"Name":"English"},"Occupations":[{"Id":1,"Name":"Banquet Server"},{"Id":2,"Name":"Bar Tender"},{"Id":3,"Name":"Catering Manager"}]
and bind it to a dropdown menu using angular JS:
$scope.industry = [];
$http.get('/industrygroup?languageid=1')
.then(function (result) {
$scope.industry = result.data;
});
and here is the HTML layout
<select class="form-control" style="width:25% !important; margin-bottom:20px;" ng-model="industry">
but my dropdown menu appears blank....what I am trying to do is display each name from the json above.....anyone have any suggestions? Here is some more of angular JS code:
var myApp = angular.module('myApp', []);
myApp.controller('WizardController', function($scope){
$scope.industry = [];
$http.get('/industrygroup?languageid=1')
.then(function (result) {
$scope.industry = result.data;
});
$scope.user = {
agree: null
};
});
$scope.user
is what I use to collect data from input fields.