1

Page A is routed with parameter(value=3, but default 1).

On A, Page B is called by clicking Anchor Tag.

And then, On B, backspace key is pressed and Page A is returned with
parameter(value=1, but expected 3)

How Can I keep state parameter on AngularJS when page is called by backspace key pressed?

Reddol18
  • 57
  • 5

2 Answers2

1

Did you use ui-router and ui-sref attribute like this?

ui-sref="app.view({foo: 'fooValue1'})"

It automatically keeps state parameters.

1

https://stackoverflow.com/a/31614517/3547361

It includes workaround with local storage to store state params.

Also it is an issue of ui router. SEE, https://github.com/angular-ui/ui-router/issues/2115.

Community
  • 1
  • 1
ddumbugie
  • 604
  • 5
  • 3