Quantcast
Channel: Ionic Forum - Latest posts
Viewing all articles
Browse latest Browse all 228595

Cached state controller instantiates on some state changes

$
0
0

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.


Viewing all articles
Browse latest Browse all 228595

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>