controllers.js
2.43 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
angular.module('starter.controllers', [])
.controller('AppCtrl', function($scope, $timeout) {
$scope.channels = CHANNELS;
})
.controller('HomeCtrl', function($scope) {
})
.controller('ChannelCtrl', function($scope, $stateParams) {
$scope.channel = $stateParams.channel;
$scope.category_object = CHANNELS[$stateParams.channel];
})
.controller('CategoryCtrl', function($scope, $stateParams, posts) {
$scope.channel = $stateParams.channel;
$scope.category = $stateParams.category;
$scope.category_name = CHANNELS[$stateParams.channel].cate[$stateParams.category];
$scope.posts = posts;
if(posts.length == 1){
$scope.post = posts[0];
}
})
.controller('PostCtrl', function($scope, $stateParams, post) {
$scope.channel = $stateParams.channel;
$scope.category = $stateParams.category;
$scope.flag = $stateParams.flag;
$scope.post = post;
})
.controller('DevicesCtrl', function($scope) {
$scope.items = [
{src: '/images/devices/01.jpg', thumb: '/images/devices/thumb-01.jpg', sub: ''},
{src: '/images/devices/02.jpg', thumb: '/images/devices/thumb-02.jpg', sub: ''},
{src: '/images/devices/03.jpg', thumb: '/images/devices/thumb-03.jpg', sub: ''},
{src: '/images/devices/04.jpg', thumb: '/images/devices/thumb-04.jpg', sub: ''},
{src: '/images/devices/05.jpg', thumb: '/images/devices/thumb-05.jpg', sub: ''},
{src: '/images/devices/06.jpg', thumb: '/images/devices/thumb-06.jpg', sub: ''},
{src: '/images/devices/07.jpg', thumb: '/images/devices/thumb-07.jpg', sub: ''},
{src: '/images/devices/08.jpg', thumb: '/images/devices/thumb-08.jpg', sub: ''},
{src: '/images/devices/09.jpg', thumb: '/images/devices/thumb-09.jpg', sub: ''},
{src: '/images/devices/10.jpg', thumb: '/images/devices/thumb-10.jpg', sub: ''},
{src: '/images/devices/11.jpg', thumb: '/images/devices/thumb-11.jpg', sub: ''},
{src: '/images/devices/12.jpg', thumb: '/images/devices/thumb-12.jpg', sub: ''},
{src: '/images/devices/13.jpg', thumb: '/images/devices/thumb-13.jpg', sub: ''},
{src: '/images/devices/14.jpg', thumb: '/images/devices/thumb-14.jpg', sub: ''}
];
})
.controller('WssjCtrl', function($scope) {
})
.controller('BgcxCtrl', function($scope) {
})
.controller('GsjjCtrl', function($scope) {
var video = document.getElementsByTagName('video')[0];
var width = video.parentElement.clientWidth - 20;
video.width = width;
video.height = width / (300 / 170.0);
// $scope.play = function(){
// }
});