Guest User

Untitled

a guest
Jan 16th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. <ion-item nav-clear menu-close ng-click="allproductpage(1)">aaa</ion-item>
  2. <ion-item nav-clear menu-close ng-click="allproductpage(2)">bbb</ion-item>
  3.  
  4. $scope.allproductpage= function(a){
  5. angular.extend(inpsf.inps, {act_cat : a}) // inpsf is service
  6. $location.path('/app/allproducts')
  7. }
  8.  
  9. .controller('AllproductsCtrl', function($scope,inpsf)
  10. {
  11. alert(inpsf.inps.act_cat)
  12. })
  13.  
  14. .controller('AllproductsCtrl', function($scope,inpsf)
  15. {
  16. $scope.$on('$routeChangeSuccess', function() {
  17. alert(inpsf.inps.act_cat)
  18. })
  19. })
  20.  
  21.  
  22. //where you config your states..
  23. $stateProvider.state('/app/allproducts/:cat', {
  24.  
  25. $scope.allproductpage= function(a){
  26. angular.extend(inpsf.inps, {act_cat : a}) // inpsf is service
  27. $location.path('/app/allproducts').search({act_cat: a})
  28. }
  29.  
  30. $ionicHistory.clearCache().then(function(){ $state.go('yourpath') })
  31.  
  32. .state('signin', {
  33. url: '/sign-in',
  34. templateUrl: 'templates/views/login.html',
  35. controller: 'LoginController',
  36. cache: false
  37. })
Add Comment
Please, Sign In to add comment