If you have a form, then most likely you're using ng-model to store those values. You could use that 'object' and pass it along with state params in your ng-route/ui-route when you move off from the page, and restore them when you come back into the page.
Or, you could use a service to store it then retrieve it. The better method is probably the ng-route/ui-route method though.
Edit: As alon has commented, I should have been a bit more forthcoming, here is an example:
State 1, ui-router (config.routes.js for example):
.state('state_one', {
name: 'state1',
params: {
formData: {}
}
})
Your form will have ng-model's in it, so let's assume it's called 'formobj', with properties off it for each input/textarea with this kind of naming struture:
formobj.input1, formobj.input2
When you leave the page on state 1 (your form page) to go to state 2, you would do something like this in your controller:
$state.go('state_two', { formData: formobj })
So we're passing 'formobj' directly to state_two, which like state_one is like so:
.state('state_two', {
name: 'state2',
params: {
formData: {}
}
})
So in the controllers for both, to access the formobj it's straightforward:
$stateParams.formData
When you come back into your original state_one where the form is, you're still passing the formobj around, and you can then use that as the model again (ie all the values you had from the form originally before you moved to another page/state). Ie:
formobj = $stateParams.formData