Get first image from rest api contect in ionic or cordova

已取消 已发布的 7 年前 货到付款
已取消 货到付款

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 离子工作框架 jQuery / Prototype 移动应用开发 WordPress

项目ID: #13267385

关于项目

远程项目 活跃的7 年前