Controller is not initialising on the same page when using $state.go or $location.href
I am using sidemenu in my ionic to app pass category Id to product page using service but data is not updating corresponding to current category Id. When I click aaa I am successfully redirected to product page and it alerts 1. Again form side menu when i click 'bbb' I get no alert. Also if I chose bbb at first then 2 is alerted and vice versa
Side menu Template
<ion-item nav-clear menu-close ng-click="allproductpage(1)">aaa</ion-item>
<ion-item nav-clear menu-close ng-click="allproductpage(2)">bbb</ion-item>
Side menu controller
$scope.allproductpage= function(a){
angular.extend(inpsf.inps, {act_cat : a}) // inpsf is service
$location.path('/app/allproducts')
}
Product page
.controller('AllproductsCtrl', function($scope,inpsf)
{
alert(inpsf.inps.act_cat)
})
P.S I am using $ionicConfigProvider.views.maxCache(0);
in my .config