Subversion Repositories SmartDukaan

Rev

Rev 13551 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 13551 Rev 13557
Line 1... Line 1...
1
angular.module('starter.controllers', [])
1
angular.module('starter.controllers', [])
2
 
2
 
3
.controller('DashCtrl', function($scope, $stateParams, Categories, CategoryProducts, localStorageService, apihost) {  
3
.controller('DashCtrl', function($scope, $stateParams, Categories, CategoryProducts, localStorageService, apihost,$location) {  
-
 
4
  $scope.me = $location.search().user_id;
-
 
5
  if($scope.me) {
-
 
6
	localStorageService.set('me',$scope.me);
-
 
7
  }else{
4
  $scope.me = localStorageService.get('me');
8
	$scope.me = localStorageService.get('me');
-
 
9
  }
5
  $scope.apihost = apihost;
10
  $scope.apihost = apihost;
6
  $scope.curpage = 1;
11
  $scope.curpage = 1;
7
  $scope.maxpages = 10;
12
  $scope.maxpages = 10;
8
  $scope.products = [];
13
  $scope.products = [];
9
  $scope.categories = Categories.all({'me':$scope.me});
14
  $scope.categories = Categories.all({'me':$scope.me});
Line 71... Line 76...
71
        return true;
76
        return true;
72
    }
77
    }
73
  }
78
  }
74
})
79
})
75
 
80
 
76
.controller('ChatsCtrl', function($scope, Products, localStorageService, apihost) {
81
.controller('ChatsCtrl', function($scope, Products, localStorageService, apihost, $location) {
-
 
82
  $scope.me = $location.search().user_id;
-
 
83
  if($scope.me) {
-
 
84
	localStorageService.set('me',$scope.me);
-
 
85
  }else{
77
  $scope.me = localStorageService.get('me');
86
	$scope.me = localStorageService.get('me');
-
 
87
  }
78
  $scope.apihost = apihost;
88
  $scope.apihost = apihost;
79
  $scope.curpage = 1;
89
  $scope.curpage = 1;
80
  $scope.maxpages = 10;
90
  $scope.maxpages = 10;
81
  $scope.products = [];
91
  $scope.products = [];
82
  $scope.loadmore = function () {    
92
  $scope.loadmore = function () {