app factory genaLoh location function location return function scope u

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
app.factory('genaLoh', [' $location', function ( $location) {
return function($scope, uploadUrl, uploadData, successCallback) {
$scope.$watch('paginate.page', function(page) {
$location.search('page', page);
});
$scope.$watch('paginate.perPage', function(page) {
$location.search('perPage', page);
$scope.paginate.page = 0;
});
};
}]);
app.controller('GenaCtrl', ['$scope', 'genaLoh',
function($scope, genaLoh) {
genaLoh($scope);
}]);