Hey guys,
Ionic and AngularJS noobie here, is there a way to make a slide box go directly to a slide using a url param (or some other way)?
For instance I have
.state('app', {
url: "/app",
abstract: true,
templateUrl: "layouts/layout.html",
controller: 'AppController'
})
.state('app.reflections', {
url: "/reflections",
views: {
'menuContent' :{
templateUrl: "views/reflections.html"
}
}
})
reflections.html contains a slide box and using a url like /reflections/1 I would like to directly navigate to that slide on that view.
I’ve tried adding
// for some reason doing app.reflections.detail doesn't work at all
.state('app.reflectionsdetail', {
url: "/reflections/work/:page",
views: {
'menuContent' :{
templateUrl: "views/reflections/work.html",
controller: 'SlideController'
}
}
})
And this is what I have in the controller
.controller('SlideController', function($scope, $stateParams, $ionicSlideBoxDelegate) {
if ($stateParams.page) {
$scope.gotoSlide($stateParams.page);
}
$scope.gotoSlide = function(index) {
$ionicSlideBoxDelegate.slide(index);
};
})
Visiting reflections/1 gives me a blank page with an empty slide box.
Any ideas?