You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
trustieforge/public/javascripts/wechat/controllers/blog.js

38 lines
1.1 KiB

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(){
}
});
}]);