Ionic Tabs with ng-repeat and ng-include


I am trying to dynamically create tabs and tab content. I am using ionic tabs directive with ng-repeat and ng-include for the tab content.

I can get the tabs to display correctly and load the tab data.

the issues I am having are that the first tab is not automatically selected. Also the tab content does not update while switching between tabs. I have noticed that the “nav-view” on the tab content is always set to “active” and never changes to “cached” when a different tab is selected.

Here is my tab template:

<ion-tabs class="tabs-striped tabs-top tabs-background-light tabs-color-energized">
<ion-tab ng-repeat="tab in tabs" title="{{title}}">
<div ng-include="'template.html'"></div>

And here is the ng-include template:

<ion-content class="scope-content has-tabs">
  <div class="card">
     <div class="list">
         <a class="item"></a>

Any help would be great.