ui-router icon indicating copy to clipboard operation
ui-router copied to clipboard

Clear $stateParams

Open seinavco opened this issue 11 years ago • 3 comments

Hello,

Is there a way to clear $stateparams?

When routing between states some the $stateParams stays there and causing me a big mess in the app. I there a way to clear stateParams?

Thanks!

seinavco avatar Jan 12 '15 16:01 seinavco

Hi, better to ask this sort of question on SOF

http://bit.ly/UIR-SOF

christopherthielen avatar Jan 15 '15 02:01 christopherthielen

You can clear the values by setting the key to undefined when you transition.

For example, to transition to the current state but clear the time parameter you can do:

$state.go('.', {time: undefined} );

srlm-io avatar Mar 03 '15 21:03 srlm-io

Thanks!

seinavco avatar Apr 15 '15 06:04 seinavco