无法从Json中获得一件物品

时间:2015-06-28 13:44:33

标签: json angularjs

尝试从这个json中拉出物品,它有效吗,有什么建议吗?

   <pre>{{statistics|json}}</pre>

<div class = "list">
        <a class =" item" 
           ng-repeat="item in statistics ">




         <p class="title"> {{item.token}} </p>  


        </a>
</div>

这是json代码:我在服务器上工作,所以你不能运行它..

app.controller('StatisticsCtrl',
        ['$scope',
          '$auth',
          'StatisticsService',
           function ($scope, $auth, StatisticsService) {

               var token = $auth.getToken(); //meant to cancel token undefined error

               console.log('StatisticsCtrl INIT');

                function run() {
                    var data = {
                        token: token,
                        timestamp_from: moment(new Date()).unix()-30 * 24 * 3600,
                        timestamp_till: moment(new Date()).unix(),
                        order: 'duration_minutes',
                        limit: 20

                    };
                    StatisticsService.getStatisticsFromServer(data).then(function (response) {

                        console.log('syncStatistics', JSON.stringify(response));

                        $scope.statistics = response;  // bring response to statistics,the jason comes from here



                    }, function (error) {
                        console.error(error);
                    });
                }

                run();

            }]);

我只得到了一些关于json本身的设置的感觉..

0 个答案:

没有答案