Why I can't use $route in my controller?


#1

I have some trouble with the slider update, it doesn’t work sometimes, even though with timeout.
So I want to reload all the view instead by $route.reload(), according to this post:

However, when I inject $route to my Controller, I got a Unknown Provider error:
https://docs.angularjs.org/error/$injector/unpr?p0=$routeProvider%20<-%20$route

Does any one know what’s the problem?


#2

Ionic doesn’t use $Route anymore, it’s been using UI Router since 0.9.26.

Check out http://angular-ui.github.io/ui-router/site/#/api/ui.router.state.$state for more information on how to change views programatically.


#3

Thanks, coen​_​warmer.
I found this, but this just reload the state, not the view. It still doesn’t solve my problem.
I want some way to reload the view. Just like you refresh a page in browser.
Any idea?


#4

AFAIK for most intents and purposes a state is the same as a view (please correct me if I’m wrong).

Have you tried this?