How To save / keep content in a Form when View is changed

Using the example of this codepen, I would like to know how to save the content (text) when I change the view.

More specifically, relating to the codepen, when I type some text into the username and password field, then click on forgot password link (bringing me to a new view), and then go back to the Sign In view, the text input is lost.

Is there a simple way to make sure the input text is not lost?

As a side note, I’m not using tabs, but rather the side-menu view type.

Here is how I implement changing a view:

<button href="#/app/report/map" ng-click="openMap()">
   Pin on Map

save it to rootScope?