I have a node.js, socket.io and angular application, where I create a "user" object whenever somebody connects to the server and puts it into my "users" array. Now I want to have angular to take the users and dynamically update the page to show the array.
//users array contains all active user objects
var users =[];
//user object (example)
var exampleuser = {
name: "Hans",
clicks: 0,
lang: "German"
}
//index.html angular scope for all active users
<table>
<thead>
<tr><th colspan="4">All online users</th></tr>
</thead>
<tbody>
<tr ng-repeat="user in UserList">
<td>{{$index + 1}}</td>
<td><img src="./img/flags/{{user.lang}}.png" /></td>
<td>{{user.name}}</td>
<td>(clicks: {{user.clicks}} )</td>
</tr>
</tbody>
</table>
So how do I have to configure my Angular controller in order to get all users from the array "users" and put them in an angular $scope? Thanks