app.controller('BlogController', ['$scope', '$http', '$routeParams', 'auth', 'common', function($scope, $http, $routeParams, auth, common){ common.init({ id: $routeParams.id, scope: $scope, type: 'blog_comments', replyType: 'BlogComment', loadCallback: function(data){ console.log(data.data); replytype = data.type; page = data.page; if (replytype == 0){ if (page == 0){ $scope.blog = data.data; } else{ $scope.blog.blog_comment_children = $scope.blog.blog_comment_children.concat(data.data.blog_comment_children); } $scope.has_more = $scope.blog.blog_comment_children.length < $scope.blog.comment_count; console.log($scope.has_more); } else{ } }, replyCallback: function(){ } }); }]);