Ionic Hardware backbutton

i can only find this line in your index.html

<script type="text/javascript">document.addEventListener("backbutton", onBackKeyDown, false);

You have to create a controller and there you need to load $ionicPlatform and then use the suggested code by mhartington.

I am using this approach in all my apps and it is working.