I am having a redirection issue while using angular ionic framework. I have a list page displaying list of records, which has a add button. When user clicks on it, it takes to the add record screen, after user is done with adding record, i am trying to redirect it to the list page so that user can see newly added record.
Here is the code i am using for redirection. This does not work. It shows the correct url on the browser window, flips the view correctly but does not retreive the newly inserted record. I tried to place a break point in my controller but my break point is not even being hit, while redirection.
$state.go('customer.detail', { 'id': key});
I also tried this but same result. It does not work either. $location.path("/detail/"+key);
ok finally i was able to fix this issue by adding a property to my state as cache:false.
.state('customer.detail', {
url: '/detail/:cid',
cache:false,
views: {
'tab-search': {
templateUrl: 'app/Customer/CustomerDetail.html'
}
}
})
Got the tip here.
Angular JS - Angular UI Router - Reloading current state - refresh data