无法从脸谱图API中提取所有“Feed”信息(图片)

时间:2016-06-25 13:16:20

标签: angularjs facebook facebook-graph-api ionic-framework

我正在尝试通过facebook API将信息提取到我的离子应用程序中。它会在我的应用中正确显示消息和日期但没有图像!我已经在这里上传了代码和演示图片。

代码:

.controller('FeedCtrl', function ($scope, $stateParams, OpenFB, $ionicLoading) {

$scope.show = function () {
    $scope.loading = $ionicLoading.show({
        content: 'Loading User Feed(s)...'
    });
};
$scope.hide = function () {
    $scope.loading.hide();
};

function loadFeed() {
    $scope.show();
    OpenFB.get('/me/feed', {
            limit: 30
        })
        .success(function (result) {
            $scope.hide();
            $scope.items = result.data;
            // Used with pull-to-refresh
            $scope.$broadcast('scroll.refreshComplete');
        })
        .error(function (data) {
            $scope.hide();
            alert(data.error.message);
        });
}

     **[<!---ionic---->][1]**

    <div ng-repeat="item in items" class="list card">
     <div class="item item-avatar">
      <img src="https://graph.facebook.com/{{ item.from.id }}/picture" />
      <h2>{{item.name}}</h2>
      <p>{{item.created_time | date:'MMM d, y h:mma'}}</p>
     </div>
     <div class="item item-body">
       <p ng-if="item.story">{{item.story}}</p>
       <p>{{item.message}}</p>
       <h2>{{item.from.id}}</h2>
       <img ng-if="item.picture" ng-src="{{item.picture}}" />
     </div>
    </div>

image

0 个答案:

没有答案