I have created the sample app by ionic
start myApp sidemenu
I have added the below logs in AppCtrl Controller as
$scope.$on(’$ionicView.enter’, function(e) {
var path = $location.path();
console.log(‘path is ::’+path);
console.log(‘viewHistory is ::’+$ionicHistory.viewHistory());
console.log(‘currentView is ::’+$ionicHistory.currentView());
console.log(‘currentHistoryId is ::’+$ionicHistory.currentHistoryId());
console.log(‘currentTitle is ::’+$ionicHistory.currentTitle());
console.log(‘backView is ::’+$ionicHistory.backView());
console.log(‘backTitle is ::’+$ionicHistory.backTitle());
});
and started the application by ionic serve it gives the below console output.
path is ::/app/playlists
viewHistory is ::[object Object]
currentView is ::[object Object]
currentHistoryId is ::ion1
currentTitle is ::Playlists
backView is ::null
backTitle is ::null
path is ::/app/playlists
viewHistory is ::[object Object]
currentView is ::[object Object]
currentHistoryId is ::ion1
currentTitle is ::Playlists
backView is ::null
backTitle is ::null
path is ::/app/playlists/3
viewHistory is ::[object Object]
currentView is ::[object Object]
currentHistoryId is ::ion1
currentTitle is ::Playlist
backView is ::[object Object]
backTitle is ::Playlists
path is ::/app/playlists
viewHistory is ::[object Object]
currentView is ::[object Object]
currentHistoryId is ::ion1
currentTitle is ::Playlists
backView is ::null
backTitle is ::null
path is ::/app/playlists/3
viewHistory is ::[object Object]
currentView is ::[object Object]
currentHistoryId is ::ion1
currentTitle is ::Playlist
backView is ::null
backTitle is ::null
- When application load why the ionicView.enter fires two times?
- If i visited the playlists 3 item it set’s the backView. again by going back button to playlists it sets the backView to null. Now reselect the same menu ie. Playlists from side menu it don’t fire any ionicView.enter event.?
- After this If i visited the 3 item again it set’s the backView to null. which causes to not showing back button on playlists/3 screen. How can i set the backView on item tap?
Thanks,
Amol.