Updated question
Question in title still stands - is it possible to catch ?parameters and cancel view reload.
Original
This can be achieved by using nested states. the code will look something like this
$stateProvider.state('viewtopic', {abstract:true,
url:/topics,
resolve: {
topic: function ($stateParams, Topic) {
// Wrapper around Restangular. Returns promise.
return new Topic().get($stateParams.slug);
}
},
views: {
templateUrl:
}
});
$stateProvider.state('viewtopic.impl', {abstract:true,
url: '/:slug?section',
onEnter: function($stateParams) {
// Works, as state has been reloaded.
console.log('$stateParams', $stateParams);
},
views: {
'main': {
controller: 'TopicCtrl',
templateUrl: 'topics/templates/details.tpl.html'
},
'sidebar': {
controller: 'SidebarCtrl',
templateUrl: 'topics/templates/sidebar.tpl.html'
}
}
for more read ->https://github.com/angular-ui/ui-router/wiki/Nested-States-%26-Nested-Views