Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <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>
- $scope.allproductpage= function(a){
- angular.extend(inpsf.inps, {act_cat : a}) // inpsf is service
- $location.path('/app/allproducts')
- }
- .controller('AllproductsCtrl', function($scope,inpsf)
- {
- alert(inpsf.inps.act_cat)
- })
- .controller('AllproductsCtrl', function($scope,inpsf)
- {
- $scope.$on('$routeChangeSuccess', function() {
- alert(inpsf.inps.act_cat)
- })
- })
- //where you config your states..
- $stateProvider.state('/app/allproducts/:cat', {
- $scope.allproductpage= function(a){
- angular.extend(inpsf.inps, {act_cat : a}) // inpsf is service
- $location.path('/app/allproducts').search({act_cat: a})
- }
- $ionicHistory.clearCache().then(function(){ $state.go('yourpath') })
- .state('signin', {
- url: '/sign-in',
- templateUrl: 'templates/views/login.html',
- controller: 'LoginController',
- cache: false
- })
Add Comment
Please, Sign In to add comment