Not clear data in using back Button

Hello Sir
My view is Below…


In my controller

In my view I am using
ng-repeat=“x in accountBalanceNodes”
{{x.slno }}
{{ x.accountNum }}
{ x.availableBalance }}  ({{x.currencyCode}})
{{x.accountType }}

When i click back button then table data is not cleared. I come again the view, then i see data will remain.
How to clear data from view?
Please help me…

Try to set the cache to false in the router :

.state(‘app.list’, {
url: “/list”,
cache: false,
views: {
‘menuContent’: {
templateUrl: “templates/nego/list.html”,
controller: ‘NegoCtrl’

I am using
.state(‘app.accBalance’, {
url: “/accBalance”,
cache: false,
views: {
‘menuContent’ :{
templateUrl: “accBalance.html”,
controller: ‘AccBalanceCtrl’

But it is not working. Please Help Me…

That’s because you are using rootscope. it will not get cleared.

you need to listen for ionicView.beforeLeave event and set $rootScope.responseArr to empty array []

1 Like

Hello yurinondual
I have done it below:

$scope.$on('$ionicView.beforeLeave', function(){   
    // alert("Before Leaving");



Thanks for your co-operation.