angularjs - Angular: How to prevent controller reload on state change -
i have settings view , settings subview:
$stateprovider .state('sidemenu.settings', { url: '/settings', views: { 'maincontent': { templateurl: 'partials/settings/settings.html', controller: 'settingscontroller' } } }) .state('sidemenu.default-location',{ url: '/default-location', views:{ 'maincontent':{ templateurl: 'partials/settings/defaultlocation.html', controller:'settingscontroller' } } })
you can notice both use same controller: settingscontroller
.
when call main settings view $state.go('sidemenu.default-location');
reloads settingscontroller
again. why?
(i don't want use ng-show/hide
)
my question if stay in controller , next state uses same controller how prevent controller reload?
Comments
Post a Comment