My application uses it $state.gowhen switching between tabs, and this leads to reinitialization of the controllers and variable scope in these controllers, which are updated and cause a memory leak. Is there a way to stop the reinitialization of the controllers, but change the URL when the state changes?
Example below: routes.js in my application.
.state('home',
{
abstract : true,
url : '/home',
templateUrl : 'scripts/home.html'
})
.state('home.summary',
{
url : '/summary?userId',
controller : 'SummaryCtrl',
views :
{
summary:
{
templateUrl: 'scripts/home/summary.html'
}
}
})
.state('home.summary.detail',
{
url : '/detail/:id',
controller : 'DetailCtrl',
views :
{
detail:
{
templateUrl: 'scripts/home/detail.html'
}
}
})
How to stop reloading DetailCtrl, but change the URL when you are going to specify home.summary.detail if DetailCtrl is already loaded for a unique id ???
Also tried to execute $ q.reject in resolving the child state, it stops reloading the controllers, but does not change the URL.
reloadOnSearch = false, , URL.