2

Currently if I want to reload a state, I have to use the $state.reload(). This causes a full page refresh, which is very unfriendly. I am looking for a way to just re-resolve my dependencies and reset the controller. Is this possible?

ewahner
  • 1,149
  • 2
  • 11
  • 23

2 Answers2

3

Just to add on @Dag 's answer:

Do note, as of 0.2.14 you also have an option to just reload the current state and not it's parent.

So $state.go(people.search, {}, {reload: true}); would reload the people state as well as all its childs.

While $state.go(people.search, {}, {reload: "people.search"}); would not reload the people state but would reload people.search and its childs.

Shyamal Parikh
  • 2,988
  • 4
  • 37
  • 78
2

you can try with:

$state.go($state.current.name, $state.params, { reload: true });

it will force transition even if the state or params have not changed without full page refresh. you can pass the state + the params + reload options.

for details look here at "go" method.

ilDug
  • 553
  • 1
  • 4
  • 11