How to preserve field values when switching tabs?

Actually, saving the text in a $scope var isn’t enough as the Tab1 scope is lost when I switch to Tab2. I updated the code to reflect that behaviour: http://codepen.io/esartor/pen/Erhpw?editors=101

I think I’d have to persist those values in a less volatile place, like sessionStorage for example.