Hello I am having a problem with the back button in my project. One of the views is a newsfeed, when i click a news item to see the full content I go to the respective view. In this view i display the full content of the news and a back button.
This is the router config for this 2 views :
$stateProvider
.state('app', {
url: "/app",
abstract: true,
templateUrl: "templates/menu/html/menu.html",
controller: 'menuCtrl'
}) //root
.state('app.news-full-list', {
url: "/news",
params:{
isAnimated:true
},
views: {
'menuContent': {
templateUrl: "templates/cholnews/news_full.html",
controller: 'newsCtrl'
}
}
}) // news feed
.state('app.details', {
url: '/news_details',
views: {
'menuContent': {
templateUrl: 'templates/cholnews/news_details.html',
controller: 'detailsCtrl'
}
}
}); //news details
To display the back button in the details view i use this script as suggested in ionic page:
appControllers.controller('detailsCtrl', function ($scope, $ionicHistory) {
$scope.myGoBack = function() {
$ionicHistory.goBack();
};
});
when I go inside details the back button is displayed but does not work when clicked.It looks like the history is empty! Any idea how t solve this ?