blob: 01fdcc3af6cf7ae948dc90e7a0dfe1ac2101a693 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
/*
* mainApp Controller
*/
mainApp.controller('statusCtrl', function ($scope,$interval,$sce)
{
// Update status every 2 seconds
$interval(function(){
var status=identity.fetchStatus();
$scope.username=status[1];
$scope.lastconnection=status[2];
if(status[0] == "1"){
$scope.connection=$sce.trustAsHtml("Connection : <span style=\"color:green;\">Online</span>");
}
else{
$scope.connection="Connection : <span style=\"color:red;\">Offline</span>";
}
}, 2000);
});
|