Git Repository Public Repository

YouAndWeb_TwoToc

URLs

Copy to Clipboard
 
a2ecfb85282bb782ae96a40499c728d5c266f710
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
'use strict';

angular.module('dashboardApp')
  .controller('ShowCtrl', function($scope, $http, $stateParams) {
    
    $scope.posters = [];
    var showId = $stateParams.id;

    $http.get('/api/shows/' + showId).then(function(response) {
      	$scope.item = response.data;
      	$scope.diffDate = Math.abs(new Date() - Date.parse($scope.item.user.dateSubscribed));

      	$scope.loadComments();
    });

    var baseLimit = 5;
    $scope.limit = baseLimit;

    $scope.loadComments = function() {
    	$http.get('/api/comments?user=' + $scope.item.user._id + '&active=true&limit=' + $scope.limit).then(function(response) {
    	  	$scope.comments = response.data;
    	  	$scope.limit += $scope.limit;
    	});
    };
  });

Commits for YouAndWeb_TwoToc/client/app/partecipa/show/show.controller.js

Diff revisions: vs.
Revision Author Commited Message
a2ecfb ... PTKDev Fri 20 Nov, 2015 11:22:35 +0000

TwoToc code