The entire lifecycle needs an overhaul in my opinion. The events don’t fire in the right order, history changes immediately before any events are fired, making canceling navigation needlessly difficult ($stateChangeStart doesn’t even cut it, fires too late) and much of the flow is simply confusing. Take $ionicNavView for example:
.controller('HomeCtrl', function($scope) {
$scope.$on('$ionicNavView.beforeLeave', function() {
console.log('before leave');
});
});
You might think this executes before you leave the HomeCtrl view, but it actually executes when entering HomeCtrl. The “before leave” part is before you leave another view, but executed in the scope of the new view. Only the history has already changed, so “before” is actually “after”.
@mhartington I know everyone is busy with turning Ionic into a viable business model, but I hope you guys can find some time to dive into this topic. Pull requests, even the low hanging fruit, have largely been ignored for the past few months, so I hope Ionic gets some love again soon.