The current solution I can think of is to save it on $rootScope, which is obviously not good...
You can save it in the Service, but what is the timing of saving? Monitor the form input and then call the setter method in real time? ~
Is there a more elegant way?~
If it is a pop-up window, you can share the same controller
If you must jump the route, there are several ways:
The $rootSope you think of is one
Alternatively, to use services, you can use $cacheFactory provided by angular itself. Its API is very simple. You can understand it just by searching. The timing of saving is just the step before you jump.
The other way is to save the parameters to the URL when jumping, and then use $stateParams to get them. It should be spelled correctly
You can write the route jump in js, and then save the information when you click to jump, and then jump after making sure it is correct
$scope.goToIndex2 = function () {
}
There is no separate save button. During ng-change, a common method is called to save the entire form, for example, in local storage
I think this is the best way
If you save when jumping routes, you need to add this saving method to all route jumps. It will be very troublesome to design more routes