In my angularjs app ,i have angular-ui-bootstrap tabs and on selection of tabs i change to different state using $state.go and with state transistion url on browser changes.
I have parent static tab pointing to $state:home.summary and dynamic tabs point to $state:home.summary.detail. When i go from parent to child, child resolve method is fired but when i move from child to parent,parent resolve doesn't fire
State changes,url changes but parent resolve is not fired and stays where it is.
Routes.js
.state('home', {
abstract: true,
url: '/home',
templateUrl: 'scripts/home.html'
})
.state('home.summary', {
url: '/summary',
controller: 'SummaryCtrl',
views: {
'summary':
{
templateUrl: "scripts/home/summary.html",
resolve: {
load: function ($rootScope,$stateParams,ServiceA) {
ServiceA.get().$promise;
}
}
}
}
})
.state('home.summary.detail', {
url: '/detail/:id',
controller:'DetailCtrl',
views: {
'detail':
{
templateUrl: "scripts/home/detail.html",
resolve: {
load: function ($rootScope,$stateParams,ServiceB,$timeout) {
var promise=ServiceB.retrieve(id);
return promise;
}
}
}
}
})
Tabs.html
<div ng-controller="TabsCtrl">
<ul tabset>
<li tab select="selectStaticTab()">
<span tab-heading>Search<a style="left:9px" class="glyphicon glyphicon-search"></a> </span>
<div class="well">
<div ui-view="summary"></div>
</div>
</li>
<li tab ng-repeat="tab in tabs track by tab.id" active="tab.active" select="tab.select()">
<span tab-heading>{{tab.title}}</span>
<div ui-view="detail"></div>
</li>
</ul>
</div>
why parent resolve is not fired from child state??? Any help will be appreciated.
Thank you