I'm using AngularJS to create a Single Page App (SPA) and am wondering how best to manage using the back button on mobile devices.
I created my application without views. One js form, one html page and no partials. The info is displayed using ng-show and a controller that helps hide <div> tags according to tab numbers assigned to them.
What I need to happen is for the application to NOT CLOSE when the back button is pushed. But since I am not passing any params to the URL (because the URL never changes) is there a really good way to give functionality to the back button on the mobile device?
Here's a code sample, but I also included a plunk to try and better help clarify my need.
<div>
<a href ng-click="toggle = !toggle">=</a>
<ul ng-show="toggle">
<li><a id="Home" ng-click="navi.selectTab(1); toggle = false">Home</a></li>
<li><a id="About" ng-click="navi.selectTab(2); toggle = false">About</a></li>
<li><a id="Contact" ng-click="navi.selectTab(3); toggle = false">Contact</a></li>
</ul>
<div ng-show="navi.isSelected(1)">
or
<div ng-show="navi.isSelected(2)">
or
<div ng-show="navi.isSelected(3)">