I'm trying to use angular-ui-router to navigate through states without reloading the controller and view. I.e. if I'm in app.posts and I navigate to app.postId using an href and click back button in the browser, the app.posts view should appear and the state should be as it was before. Currently the state is reloaded as if it was opened for the first time.
Also html5mode is enabled on the $locationProvider.
The states are defined as
app.config(function($stateProvider, $locationProvider) {
$stateProvider
.state('app.home', {
url: '/home',
templateUrl: 'js/main/templates/home.html',
controller: 'HomeCtrl'
})
.state('app.posts', {
url: '/',
templateUrl: 'js/PostList/PostList.html',
controller: 'PostListCtrl',
deepStateRedirect: true
})
.state('app.postId', {
url: '/post/:id',
templateUrl: 'js/Post/Post.html',
controller: 'PostViewCtrl'
});
$locationProvider.html5Mode({enabled:true, requireBase:false});