Get next/previous post from wordpress with ionic

I’m creating an app for my wordpress blog using Ionic framework, it gets the latest post thumbnail (as my posts are basically a picture per post), I want to fetch previous post or next post using buttons or by swiping left or right, how can I do it, I’ve searched a lot but I only found infinite scroll method.


Here’s my code: (controller.js)

angular.module('starter.controllers', [])
.controller('LatestCtrl', ['$scope', '$http', function($scope, $http){
$scope.recent_posts = [];  
   $scope.recent_posts =;
   $ = $scope.recent_posts[0].id;
   $scope.recent_post_img = $scope.recent_posts[0].thumbnail_images.full.url;
}, function(err){


<ion-view ng-controller="LatestCtrl" cache-view="false">
<ion-list class="list list-inset" on-swipe-left="" on-swipe-right="" can-swipe="true">
  <ion-item class="item item-image">
    <img ng-src="{{recent_post_img}}">
    <ion-item class="row item">
      <div class="col">
          <a class="button button-clear button-icon icon ion-ios-arrow-right button-ht" href="#"></a>
      <div class="col "><button class="button button-clear button-ht icon ion-android-share-alt icon-left" ng-click="share();"></button></div>
      <div class="col "><button class="button button-clear button-icon icon ltr ion-ios-heart-outline button-ht" ng-click=""></button></div>
      <div class="col">
       <a class="button button-clear button-icon icon ion-ios-arrow-left button-ht" href="#"></a>

Any help? I’m really stuck on this for weeks

Did you found a solution, me too stuck on this for a week.