As soon as a websocket message is received, the code below executes:
connection.onmessage = function (eventInfo) {
var onConnectionMessage = JSON.parse(eventInfo.data);
if (onConnectionMessage.messageType === "newRequest") {
getQuizRequests();
}
}
The function getQuizRequests() looks like this:
function getQuizRequests() {
var URL = '/acceptOrReject/' + lookUpCode();
$http.get(URL)
.success(function (data) {
for (var i = 0; i < data.teamArray.length; i++) {
teamArray[0] = data.teamArray[i];
}
})
.error(function (data, status) {
alert("ERROR data cant be loaded");
});
}
I have an array called teamArray that I want to use in an ng-repeat. How can I pass this filled array to where I'm using ng-repeat in my code?