将数据推入ng-repeat成为空白数据

时间:2014-12-06 10:25:34

标签: javascript angularjs

app.controller('tContentCtrl', ['$scope', '$http','$stateParams','$timeout','getTopicContent', function($scope,$http,$stateParams,$timeout,getTopicContent){

    $scope.ionLoader = true;
    $scope.threadContent = [];

     var promise = getTopicContent.request($stateParams.topicId).then(function(response){
        $scope.threadContent = response.data;

        totalPages = response.data[0].totalPages;

        console.log(response.data);


    }).finally(function(){
        $scope.ionLoader = false;
    });

    $scope.loadPages = function() {
        if(totalPages > 1){
                $http({
                url: "http://www.corsproxy.com/daysof.me/lowyat/thread.php",
                method: "GET",
                params: {topicId: $stateParams.topicId}
            }).success(function(data){
                 promise.then(function(none) { 
                    $scope.threadContent.push(data); 
                    console.log(data);
                 });
            });
        }
    }

在上面的两个console.log(数据)中,结果是相同的,这意味着我的数据不为空。我希望实现无限滚动它推送空白数据。

0 个答案:

没有答案