I'm relatively new to utilizing $http and fetching data from various websites. My main query is, how can I convert JSONP into HTML? Specifically, when using $http to request the Atari Wikipedia page, the content is displayed with
and HTML elements. How can I ensure that the data renders correctly?var app = angular.module('app', []);
app.controller('DataCtrl', ['$scope', '$http',
function($scope, $http) {
// $scope.list;
var url = 'http://en.wikipedia.org/w/api.php?titles=atari&rawcontinue=true&action=query&format=json&prop=extracts&callback=JSON_CALLBACK';
$http.jsonp(url).success(function(data) {
$scope.info = data.query.pages[2234].extract;
}).error(function(data) {
$scope.data = "Error";
});
}
]);
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0/angular.min.js"></script>
<div id="wrapper" ng-app="app">
<div ng-controller="DataCtrl">
<div>{{info}}</div>
</div>
</div>