2016-04-07 7 views
1

私は現在ng-walkthroughディレクティブ(Plunker:http://plnkr.co/edit/kHM9zHCxAA3gPYvedmdw?p=preview)を使用して、自分のアプリケーションの一連のオンスクリーン手順を作成しています。ng-walkthroughディレクティブが起動する前に遅延を設定します。

アニメーションが自動的に読み込まれる前に遅延を設定したいと思います。誰もがこれを行うための最善の方法を知っていますか?

enter image description here

controller.js

<walkthrough 
    id="accounts_view_walkthrough" 
    walkthrough-type="transparency" 
    focus-element-id="{{ accountsWalkthrough.steps[accountsWalkthrough.currentIndex].id }}" 
    main-caption="{{ accountsWalkthrough.steps[accountsWalkthrough.currentIndex].text }}" 
    force-caption-location="BOTTOM" 
    is-active="showAccountsWalkthrough" 
    is-bind-click-event-to-body="true" 
    on-walkthrough-hide="nextAccountsWalkthrough()" 
    is-round="false"> 
</walkthrough> 
+0

'setTimeout'で' showAccountsWalkthrough'を実行するとどうなりますか? – swapnesh

+0

@swapnesh - どうすればいいですか? – methuselah

+0

これは 'is-bind-click-event-to-body =" true "'オプションは何をするのですか?私はプラグインのドキュメントでそれを見ませんでしたか? – IonicBurger

答えて

0

view.html

$scope.showAccountsWalkthrough = true; 

$scope.accountsWalkthrough = { 
    steps : [ 
     { 
      id: "new-account-button", 
      text : "Some text here" 
     }, 
     { 
      id: "scan-all-button", 
      text : "Some text here" 
     }, 
     { 
      id: "accounts-list", 
      text : "Some text here" 
     } 
    ], 
    currentIndex : 0 
}; 

$scope.nextAccountsWalkthrough = function() { 
    ionic.requestAnimationFrame(function() { 
     if($scope.accountsWalkthrough.currentIndex < $scope.accountsWalkthrough.steps.length-1) { 
      $scope.accountsWalkthrough.currentIndex++; 
      $scope.showAccountsWalkthrough = true; 
     } 
    }); 

}

これはISSUを解決しましたe。

関連する問題