I’m having an issue with the new ion-slides. For some reason, it only seems to be working with Android. When I test the app on an iPhone with Ionic View, or even when I use ionic serve --lab the iOS part won’t work, but the Android part will. Here is my code for my controller, with my markup at the bottom. What am I doing wrong?
.controller('MenuCtrl', function($scope, menuItems, $ionicActionSheet) {
$scope.menuTypes = menuItems.all();
$scope.show = function(item) {
// Show the action sheet
var hideSheet = $ionicActionSheet.show({
buttons: [
{ text: 'See Map of Ingredients' },
{ text: 'Add to Order' }
],
buttonClicked: function(index) {
if (index === 0) {
//Link to map of ingredients
} else if (index === 1){
//Add to order
}
return true;
}});
}})
<ion-slides options="options" slider="slider">
<ion-slide-page ng-click="show(item)" class="food-image" ng-repeat="item in menuTypes" ng-style="{'background-image' : 'url({{item.image}})'}">
<a class="item" ng-click="show(item)">
<p>{{item.description}}</p>
</a>
</ion-slide-page>
</ion-slides>
No, I never did. I really only needed it for a hobby project, so I haven’t looked into it much more, but I’d be interested if someone figured this out.
Hm. This didn’t work for me immediately. I don’t really understand why it would work, that’s interesting though. Thanks for posting. I’ll keep poking around on it and see if anything works.
hello, @rberthome i am working on <ion-slides>
slider working on android perfectly but not working on ios.
here is my code. please give me some idea so i can view ionic slider on both platform.
Has anyone found a solution to this besides ng-if=“true”? I’m having the same issue with ion-slides and I am also using images. I’ll keep working on it and post if I find anything.
@thaker, thanks for letting me know. Before I saw your solution, I already began implementing a dual template solution http://ionicframework.com/docs/platform-customization/dynamic-templates.html. I tried to use your solution since it would simplify my code but it was difficult to motivate to make all those formatting changes, when I was already close to a working solution. My working ios template looks like this: