我正在使用插件wp-api,如何从这个url获取帖子标题等数据?
http://scd.blaze.wpengine.com/wp-json/posts?type=listings&filter[listing_area]=northwest
我正在尝试使用 Angular JS 来获取它,到目前为止我有这段代码 -
<script>
var app = angular.module('myApp', []);
app.controller('regionsLinks', function($scope, $http) {
var url = 'http://scd.blaze.wpengine.com/wp-json/posts?type=listings&filter[listing_area]=northwest';
$http.get(url).then(function (data) {
$scope.data = data;
});
});
</script>
<div ng-app="myApp" ng-controller="regionsLinks">
<div ng-repeat="d in data">
<div id="title">
{{d.title}}
</div>
</div>
我意识到我在做一些根本错误的事情,但我不知道是什么,我对这一切都很陌生,
任何帮助将不胜感激,谢谢!