Get first image from rest api contect in ionic or cordova

Đã Hủy Đã đăng vào 7 năm trước Thanh toán khi bàn giao
Đã Hủy Thanh toán khi bàn giao

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

HTML5 Ionic Framework jQuery / Prototype Mobile App Development WordPress

ID dự án: #13267385

Về dự án

Dự án từ xa 7 năm trước đang mở