How to navigate history back in ionic application - android

$ionicHistory monitors or maintains the navigation history in the application. We can navigate backwards programmatically using the goBack function.

Following code Navigates to the previous window using $ionicHistory,


Equivalent code to the above one.


   Where, “-1” indicates the level.

Navigate to two (2) views backward