ionic
ionic copied to clipboard
Not working when tabs are dinamically created
Pleaseeeeeeeeeee help!!
The dummy data test of the plugin is working perfectly. But when i generate the tabs dinamically using ng-repeat it doesn't work.
This is a simple example of taking the data from an object:
$rootScope.data_test = {};
$rootScope.data_test.days = ['Day 1','Day 2'];
<tab-slide-box>
<div class="tsb-icons">
<div class="tsb-ic-wrp">
<a href="javascript:;" class="ion-home" ng-repeat="day in data_test.days track by $index"></a>
{{ day }}
</div>
</div>
<ion-slide-box show-pager="false" on-slide-changed="slideHasChanged($index)">
<ion-slide>
<h1>Day 1 content</h1>
</ion-slide>
<ion-slide>
<h1>Day 2 content</h1>
</ion-slide>
</ion-slide-box>
</tab-slide-box>
What can i do? There is something i am missing? Thank you!
Ok i find a workaround making something by my own using ion-scroll: http://ionicframework.com/docs/api/directive/ionScroll/
Anyway if the project is not updated anymore i suggest you to remove it from github. It will save some time to other developers.
This works for me:
<tab-slide-box ng-if="data_test.days">
And add data_test.days to $scope
Thanks. I prefere anyway not to use a dead plugin. I can make a very similar thing using ion-scroll, except for the possibility to swipe. But it's okay.
Yes, me too, but I'm integrating and implementing services, and plugins, developed, by another frontend enginner, so, I had to, but the solution is easy, and could help to others.
Yes, good point.