title: Simple code on swiping right and left to go back and fourth on a page using angular
body: <p>So I am working on a single page app and I am looking for a very simple code, if possible, to go back to a previous page while swiping. I have looked into many, but all seem to be very complex and very different. </p>
  
  <p>All I want is to go back and fourth from a page by swiping. Nothing too complex really. Maybe using <code>ng-swipe-right</code> and <code>ng-swipe-left</code>? Also, this is an app for a garden center where they can look up some of their inventory.</p>
  
  <p>Here is my index.html code:</p>
  
  <pre><code>&lt;div class="main"&gt;
      &lt;div ng-view&gt;&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Here is my app.js code:</p>
  
  <pre><code>var app = angular.module('myApp',[
      'ngRoute',
      'myApp.Home',
      'myApp.Search',
      'myApp.Inventory',
      'myApp.Sub',
      'myApp.Details'
  ]);
  
  app.config(function($routeProvider){
      $routeProvider.
          when('/home', {
              templateUrl: 'templates/home/home.html',
              controller: 'HomeController'
          }).
          when('/search', {
              templateUrl: 'templates/search/search.html',
              controller: 'SearchController'
          }).
          when('/inventory', {
              templateUrl: 'templates/inventory/inventory.html',
              controller: 'InventoryController'
          }).
          when('/coupons', {
              templateUrl: 'templates/coupons/coupons.html'
          }).
          when('/sales', {
              templateUrl: 'templates/sales/sales.html'
          }).
          when('/events', {
              templateUrl: 'templates/events/events.html'
          }).
          when('/locations', {
              templateUrl: 'templates/locations/locations.html'
          }).
          when('/subInventory/', {
              templateUrl: 'templates/subInventory/subInventory.html',
              controller: 'SubInventoryController'
          }).
          when('/detailsInventory/:productId', {
              templateUrl: 'templates/detailsInventory/detailsInventory.html',
              controller: 'DetailsInventoryController'
          }).
          otherwise({
              redirectTo: '/home'
     });
  });
  </code></pre>