javascript - mydata.feed is undefined ionic angularjs -
i using ionic angularjs
, want data json
have problem withe code
var app = angular.module('app.news', ['ionic']); app.controller('myctrl', function($scope, $http) { $http.get("https://graph.facebook.com/v2.5/me?") .then(function(mydata) { $scope.news = mydata.feed.data; }); });
html
<ion-view title="الرئيسية" id="page2" style="background-color:#ffffff;" class=" "> <ion-content padding="true" class="has-header"> <div ng-controller="myctrl"> <h1>{{news.message}}</h1> </div> </ion-content> </ion-view>
error: mydata.feed undefined
some please
try
mydata.data.feed.data
your response wrap inside data returns promise object.
the response object has these properties:
data – {string|object} – response body transformed transform functions.
status – {number} – http status code of response.
headers – {function([headername])} – header getter function.
config – {object} – configuration object used generate request.
statustext – {string} – http status text of response.
refer angularjs $http
Comments
Post a Comment