I\'ve switched to to ui-router. Everything went smoothly, except one thing. On my page I have a select that changes the context of the application. Anyway, previously, when
Ok it works when I inject $state into controller.
But when injecting it into service like code snippet, of course $state was undefined.
Although
$state.go('.')
did not work, I did something like this:
$stateProvider
.state('home', {
controller: function ($state) {
$state.go('advisoryLeadOffering.packages');
}
})
.state('advisoryLeadOffering.packages', {
url: "/packages",
templateUrl: "/AdvisoryLeadOffering/Packages",
controller: 'AdvisoryLeadOfferingPackages'
})
and when I need to reload I do something like this:
$state.transitionTo('home');
inside scope's method.