Get first image from rest api contect in ionic or cordova
₹600-1500 INR
货到付款
I am connecting my app with the wordpress site and i have installed rest api plugins. Now i am able to display content from the json out put. Now i want to get the very first image from the retrieved content.
Json Response CoDE
"content":{"rendered":" hello hellohello hellohellohellohellohello **** < img src="" />
I want to extract the img src URL.
here is my ionic code
.controller('MyCtrl', function($scope, $http){
$[url removed, login to view] = [];
$[url removed, login to view] = 1;
$[url removed, login to view] = function(){
$[url removed, login to view](wordpress_url+'/wp-json/wp/v2/posts' ,{
params:{"page":$[url removed, login to view],"per_page":wordpress_per_page}
}).then(function(response){
if([url removed, login to view] == 0) {
$[url removed, login to view] = $[url removed, login to view] -1;
$[url removed, login to view] = true;
}
[url removed, login to view]([url removed, login to view], function(item){
[url removed, login to view] = new Date([url removed, login to view]).getTime();
});
[url removed, login to view]([url removed, login to view], function(item){
$[url removed, login to view](item);
});
$scope.$broadcast('[url removed, login to view]');
$[url removed, login to view] = $[url removed, login to view] +1;
});
};
})
P.S.: IT IS VERY SMALL STUFF, BUDGT IS 200 INR/- ONLY
项目ID: #13267385