ionic $ionicTabsDelegate

<body ng-controller="MyCtrl">   <ion-tabs>     <ion-tab title="Tab 1">       Hello tab 1!       <button ng-click="selectTabWithIndex(1)">Select tab 2!</button>     </ion-tab>     <ion-tab title="Tab 2">Hello tab 2!</ion-tab>   </ion-tabs> </body>
function MyCtrl($scope, $ionicTabsDelegate) {   $scope.selectTabWithIndex = function(index) {     $ionicTabsDelegate.select(index);   } }


Methods

select(index)//跳转第几个tab页面

selectedIndex()//当前tab的索引

$getByHandle(handle)//事件处理

handle(string)

  • Returns: delegateInstance A delegate instance that controls only the ionTabs directives with delegate-handle matching the given handle.

  • Example: $ionicTabsDelegate.$getByHandle('my-handle').select(0);



你可能感兴趣的:(ionic $ionicTabsDelegate)