I'm getting fine my JSON data from a server, but the problem comes when trying to list it at my page using the ng-repeat directive.
Here's my HTML body content, where 'mydata' (JSON array) is shown correctly as soon as the $http.get() method receives the data requested, but the ng-repeat is not listing the array elements:
<body ng-app="myapp">
<div ng-controller="MyController" >
Data from server: {{ mydata }}
</div>
<hr>
<ul ng-controller="MyController as controller">
<li ng-repeat="data in controller.mydata">
{{ data }}
</li>
</ul>
</body>
And here is the Javascript code:
var URI = 'http://my_service_uri/';
angular.module("myapp", [])
.controller("MyController", function($scope, $http) {
$scope.mydata = [];
$http.get(URI)
.then(function(result) {
$scope.mydata = result.data;
});
});