trying to figure out how to implement Facebook's message badge notification
$scope.messageCount would later be interpolated within the badge elements
var monitor = function() { setTimeout(function() { console.log('monitoring ..'); MessageFactory.getMessages('545846a622f1a2a188405579', function(messages) { $scope.messages = messages; $scope.messageCount = messages.length; }); monitor(); }, $scope.global.refreshInterval); }; monitor();
or probably I'm better off with an infinite loop?
- Rain
No comments:
Post a Comment