I have a state with a controller, and I have cache: true set. Sometimes when I navigate to the state after the first time, the controller is being instantiated. Why? Shouldn't the state be cached, and the controller only instantiated once?
Here is my config for the state:
.state('foo-state', {
cache: true,
url: '/foo-state',
views: {
'menuContent': {
templateUrl: 'modules/foo/views/foo-state.html',
controller: 'FooStateController'
}
}
})
I have been trying different ways of navigating to the state by clicking the browser back button, but using $state.go, and by manually typing the state into the address bar, and I've tried navigating starting from different states. I can't find a consistent pattern. Any help would be awesome.