Hardware back button

how to exit app, when hardware back button is clicked? how to solve this issue using – $ionicHistory

this since 1.0.1 the default behavior on android, when the history stack is empty.

in other cases you need to overwrite backbutton function:

         $ionicPlatform.registerBackButtonAction(function (evt) {
                // prevent default backbutton action
                ionic.Platform.exitApp(); // stops the app
        }, 100);