<!DOCTYPE html>
<html>
<head>
<link data-require="bootstrap-css@3.x" data-semver="3.2.0" rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" />
<script data-require="angular.js@*" data-semver="1.3.0" src="//code.angularjs.org/1.3.0/angular.js"></script>
<script data-require="ui-bootstrap@0.10.0" data-semver="0.10.0" src="http://angular-ui.github.io/bootstrap/ui-bootstrap-tpls-0.10.0.js"></script>
<link rel="stylesheet" href="style.css" />
<script src="../script1.html"></script>
</head>
<body ng-app="myapp">
<div ng-controller="departureContrl" >
<table >
<tr id="$index" ng-repeat= "a in data" ng-click="getselectedRow(a)">
<td> {{a.destinationStation.stationName}} </td>
<td> {{a.platformNo}} </td>
</tr>
</table>
</div>
</body>
</html>
// Code goes here
var app=angular.module("myapp",[]);
app.factory('test', function($http) {
//This whole object is returned when the Service runs. It is a singleton
//and its properties can be accessed from any controller
return {
stationDashBoard: function(callback,error) {
$http.get('http://184.106.159.143:8180/FGRailApps/jservices/rest/a/departure?crsCode=VIC').success(callback).error(error);
}
}
});
app.controller('departureContrl',function($scope,test, $interval){
setData();
$interval(setData, 1000*60);
function setData(){
$scope.loading=true;
test.stationDashBoard(function(data){
console.log(data);
$scope.data=data.data;
$scope.loading=false;
//alert(data);
},function(error){
alert('error')
}) ;
}
});
/* Styles go here */