app factory genaLoh location function location return function scope s

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
app.factory('genaLoh', [' $location', function ($location) {
return function(scope) {
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);
//bidlocode
}]);