3 angular.module('dashboardApp')
4 .controller('ShowCtrl', function($scope, $http, $stateParams) {
7 var showId = $stateParams.id;
9 $http.get('/api/shows/' + showId).then(function(response) {
10 $scope.item = response.data;
11 $scope.diffDate = Math.abs(new Date() - Date.parse($scope.item.user.dateSubscribed));
13 $scope.loadComments();
17 $scope.limit = baseLimit;
19 $scope.loadComments = function() {
20 $http.get('/api/comments?user=' + $scope.item.user._id + '&active=true&limit=' + $scope.limit).then(function(response) {
21 $scope.comments = response.data;
22 $scope.limit += $scope.limit;