Using the following code, when a page with id=0
loads first time there is no problem with controller. But when again the same page loads with same id=0
again, it does not loads controller.
$state.go('tab.dash', {
id: $rootScope.products[CONSTANTS.i].id
}, {
reload: true
});
How does it happen? Please suggest me a solution.
I encountered a similar problem where I needed stats to recalculate every time a tab was visited.
You need to disable view caching. You can do so in the route setup. For example:
.state('tab.stats', {
url: '/stats',
views: {
'tab-stats': {
templateUrl: 'templates/tab-stats.html',
controller: 'StatsCtrl'
}
},
cache: false
})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With