简体   繁体   中英

Parse Json array using angular http.get

Can any one tell me how to parse this API using Angular . I want to get all unis array elements.

$http.get('https://www.coursera.org/maestro/api/topic/list2').success(function(data)
{
    console.log("UniCtrl:" + data.unis);
    $scope.unis = data.unis;
});

But data.unis is showing as undefind .

$http.jsonp('https://www.coursera.org/maestro/api/topic/list2').success(function(data) {
    JSON.parse(data); // to parse it
    console.log(data); // to see what it returns
    $scope.unis = data.unis;
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM