LoginSignup
2
2

More than 5 years have passed since last update.

[ionic] controllerでページ遷移する際にトランジションをコントロールする方法

Last updated at Posted at 2016-02-05

リンクでの画面遷移ではなく、コントローラーで画面遷移(location.href)をする際にトランジションをコントロールする方法です。

リンクの場合のトランジション

nav-transitionで設定する

hage.html
<a nav-transition="none" href="#/huga">Huga</a>

コントローラーでの画面遷移方法

$ionicViewSwitcherで設定する

hage-ctrl.js
controller.controller('HageCtrl', function ($scope, $ionicViewSwitcher) {

  $scope.move = function(){
    $ionicViewSwitcher.nextTransition('none');
    location.href = '#/huga' 
  }

}
2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2