I cant to find a way to bind the elements of the array using the data-ng-repeat directive to the html page that contains the script below. The problem is that the Quizes looks like this:
[{"quizname":"Quiz 1", "username":"musa"...}]
<script>
var app = angular.module("QuizApp");
app.controller("QuizCntrl",function($scope,$http){
var onSuccess = function(data, status, headers, config){
$scope.Quizes = data.getQuizesResult; //Returns an size5, checked it using console.log
};
var promise = $http.get("http://localhost:59503/Service1.svc/GetQuizes");
promise.success(onSuccess);
});
</script>
So when i try doing this:
<div data-ng-controller="QuizCntrl">
<table>
...
<tr data-ng-repeat = "quiz in Quizes">
<td>{{quiz.username}}</td>
<td>{{quiz.quizname}}</td>
<tr>
...
</table>
Nothing gets displayed. In the tutorials and online examples that I've done all arrays look something like this:
$scope.array = [{username: "value".....}]
How can i work around those quotations on my field names to use the data-ng-repeat directive? Any small help will be appreciated. Thank You.