My html:
<div id="body" ng-controller="ClientController"> <select kendo-drop-down-list> <option data-ng-repeat="client in Clients">{{ client.Name }}</option> </select> <button data-ng-click="loadClients()">Load Clients</button> <pre>http response data: {{ data }}</pre> </div> @Scripts.Render("~/bundles/index")
And my javascript:
function ClientController($scope, $http) { $scope.url = "/tracker/api/client"; $scope.selectedClient = null; $scope.Clients = null; $scope.loadClients = function () { $http.get($scope.url).then(function (response) { $scope.data = response.data; $scope.Clients = response.data; }); }; }
When I click the button, I get a bunch of json from my webapi server - this data is displayed in the response data section in order, but my drop-down list is always empty. The HTML page shows this:
<option value="? object:null ?"></option>
What I take means that I do not receive the data correctly. I am obviously angular n00b :) what am I missing?
source share