2016-10-14 8 views
0

私がようにイオン性タブのテンプレートを使用してアプリケーションを持っている:ネストされたビュー

// setup an abstract state for the tabs directive 
    .state('tab', { 
    url: '/tab', 
    abstract: true, 
    templateUrl: 'templates/tabs.html', 
    }) 

    // Each tab has its own nav history stack: 
    .state('tab.trips', { 
    url: '/trips', 
    views: { 
     'tab-trips': { 
      templateUrl: 'templates/trips.html', 
      controller: 'TripsCtrl', 
     } 
     } 
    }) 

.state('tab.trip-detail', { 
    url: '/trips/:tripId', 
    views: { 
     'tab-trips': { 
     templateUrl: 'templates/trip-detail.html', 
     controller: 'DestinationCtrl', 
     } 
    } 
    }) 

ここでは、抽象状態「タブ」、「tab.trips」内の最初のマスターのビューを持っており、その詳細ビュー 'tab.trip-detail'。

詳細ビュー 'tab.trip-detail'の内部このビューでは、さまざまな状態のさまざまなテンプレートを表示できます。

この状態を設定する方法がわかりません。

答えて

1

はい、もちろん可能です。私はあなたがng-includeを使用することをお勧め:コードの

サンプルは、あなたが参照することがあります。

<ion-pane> 
    <ion-tabs> 
     <ion-tab title="Tab 1"...> 
      <ion-view> 
       <div ng-include src="'templates/tab1.html'"></div> <!-- You can manipulate this source --> 
      </ion-view> 
     </ion-tab> 
     <ion-tab title="Tab 2"... > 
      <ion-view> 
       <div ng-include src="'templates/tab2.html'"></div> <!-- You can manipulate this source --> 
      </ion-view> 
     </ion-tab> 
    </ion-tabs> 
</ion-pane> 
+1

は、緑色のチェック与えた - 私はdivを使用し、このアプローチの使用済み部分を私が必要私の何を達成するためのディレクティブをNGが、含まれています。乾杯 – Vince

関連する問題