kingstakh,
<!DOCTYPE html>
<html ng-app="app">
<head>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular.min.js"></script>
<meta charset="utf-8">
<title>Расписание</title>
<script>
var c = {
formatTime: function(b) {
b = Math.floor(b / 1E3);
var a = Math.floor(b / 60),
d = Math.floor(a / 60);
b %= 60;
a %= 60;
return c.two(d % 24) + " час. " + c.two(a) + " мин. " + c.two(b) + " сек. "
},
two: function(b) {
return (9 < b ? "" : "0") + b
}
};
angular.module("app", [])
//Часы
.controller("TimeCtrl", function($scope, $interval) {
var tick = function() {
$scope.clock = Date.now();
}
tick();
$interval(tick, 1000);
})
.controller("TabsDemoCtrl", function($scope) {
$scope.work = '6:00, 8:45, 12:00, 12:10, 12:35, 23:37'; // Рабочие дни
$scope.weekend = '6:00, 8:45, 13:00, 14:10, 15:35, 23:50'; // Выходные дни
$scope.fn = function ()
{ function foo(data) {
var el = data.match(/\d+/g);
var date = new Date;
date.setHours(+el[0], +el[1],0,0);
date = date.getTime() - (new Date).getTime();
return data + ' ' + (date < 0 ? "Автобус ушел" : "Осталось : " + c.formatTime(date));
}
$scope.myArray = $scope.work.split(',').map(foo)
$scope.arrString = $scope.weekend.split(',').map(foo)
window.setTimeout($scope.fn,1000) // Вывод данных в приложении работает
}
$scope.fn()
});
</script>
</head>
<body>
<h3 ng-controller="TimeCtrl">Сейчас {{ clock | date:'HH:mm:ss'}}</h3>
<ul ng-controller="TabsDemoCtrl">
<li ng-repeat="bustime in myArray track by $index">
{{bustime}}
</li>
</ul>
<ul ng-controller="TabsDemoCtrl">
Здесь для выходных дней
<li ng-repeat="bustime in arrString track by $index">
{{bustime}}
</li>
</ul>
</body>
</html>