How to swipe tabs to change the data?

@mhartington @max

   How to swipe the tabs like  swipe to move "One Page" to "Another page"? (google store play - like).   Please help me.

Thank you.


Are you looking for $state.go(STATE_NAME);? And then add swipe event listener on your controller or just define a directive.

Yeah. I got it. thank you.

I want to animate movie Images automatically. do you know about this? Can you help me please

You may looking for the ionic directive ionic-slide, something like this:

      <img src="" alt="">
      <img src="" alt="">
      <img src="" alt="">

Or if you want to swipe to change state, you can do something like this:

var app = angular.module('YOUR_APP', []);

app.directive('swipeToState', ['$state', function ($state) {
  return {
    restrict: 'A',
    scope: {
      swipeToState: '@'
    link: function (scope, iEle, iAttrs) {
      // `swipe` is one of gestures which ionic supports,
      // more event types in
      iEle.on('swipe', function () {

Just add this directive to the element you want to listen after define the swipeToState directive, e.g.

<!-- `app.productList` is the state you have defined in your `app.config()` -->
<body swipe-to-state="app.productList">
  <!-- ... -->

That’s all I know about this question, hope this can help you :smile:

1 Like

I agree with you @santinowu :smile:

From above code we have to swipe images. But i don’t need that requirement. I want to animate images automatically. For ex. In play store newest app screens automatically swiping.

Thank you.

sorry for my English Language. :wink:

Then you have to use

<ion-slide-box does-continue="true" auto-play="true"> ...

Check the pen

Well @vicmota Thank you :smile:

But 1st image moving automatically. from second onwards images not moving to further images.

In case someone else is looking for animated tabs or swipable tabs, i just created a directive for that matter.
just give it a try, GitHub repository.