Handling the hardware back buttons

Thank you all for your code samples and suggestions. I have now implemented my own back button routing in my app.

@imesky, try using native dialog with ngCordova.

E.g.

angular.module('myApp.UI', [])
    .factory('UI', ['$cordovaToast', '$cordovaDialogs',
        function ($cordovaToast, $cordovaDialogs) {
            var self = this;
            self.toast = function (message, duration, position) {
                var msg, dur, pos;
                msg = message || '';
                dur = duration || 'short';
                pos = position || 'bottom';
                return $cordovaToast.show(msg, dur, pos);
            };
            self.alert = function (title, msg) {
                return $cordovaDialogs.alert(msg, title, 'OK');
            };
            self.confirm = function (title, msg) {
                return $cordovaDialogs.confirm(msg, title, ['Yes', 'No']);
            };
            return self;
        }
    ]);