Files
web2.0-backend/infoscreen/static/js/infoscreen_controllers.js
T
2016-09-13 17:10:32 +03:00

37 lines
1.2 KiB
JavaScript

var app = angular.module('infoApp', ['ngAnimate']);
app.controller('infoscreen_main', function($scope,$timeout){
$scope.index = -1;
var templates = [
{
template: "/static/html/test1.html?img=otatarha",
onload: function(){$scope.imagepath = "/static/img/otaajot16fb.png";}
},{
template: "/static/html/abb.html"
},{
template: "/static/html/test1.html?img=otaolut",
onload: function(){$scope.imagepath = "/static/img/otaolutbanner.jpg";}
},{
template: "/static/html/test1.html?img=asw",
onload: function(){$scope.imagepath = "/static/img/asw.png";}
},{
template: "/static/html/test1.html?img=fujitsu",
onload: function(){$scope.imagepath = "/static/img/fujitsu.png";}
},
];
$scope.next = function(){
$scope.index = ($scope.index + 1) % templates.length;
$scope.active = templates[$scope.index];
$timeout($scope.next,15000);
}
$scope.next()
});
app.controller('ABBController', function($scope, $http){
$scope.jobs = [];
$http.get("/infoscreen/abbjobs").then(function(response){
$scope.jobs = response.data;
})
});