Created
September 28, 2015 09:21
-
-
Save tkc/7dcfb0b390697f37f9b3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var getItemLists = function () { | |
var data = { | |
'item_dealer_id': global.dealer_id, | |
'skip': _skipCountItemLIst | |
}; | |
var req = { | |
method: 'POST', | |
url: _rootListItem, | |
data: JSON.stringify(data) | |
}; | |
$http(req) | |
.success(function (res) { | |
var list = res.data.res; | |
if (list.length == 0) { | |
_itemListsPushFlag = false; | |
} | |
_.each(list, function (v, k) { | |
$scope.items.push(v); | |
}); | |
_skipCountItemLIst += list.length; | |
if (!$scope.$$phase) { | |
$scope.$apply(); | |
_skipCountItemLIst += res.data.res.length; | |
} | |
_items = $scope.items; | |
getCategory(); | |
}) | |
.error(function () { | |
}); | |
}; | |
var roop = function () { | |
setInterval(function () { | |
if (_itemListsPushFlag) { | |
getItemLists(); | |
} | |
}, 2000); | |
}; | |
roop(); | |
getItemLists(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment