Skip to content

Instantly share code, notes, and snippets.

@slvdrog
Created August 16, 2012 17:16
Show Gist options
  • Select an option

  • Save slvdrog/3371801 to your computer and use it in GitHub Desktop.

Select an option

Save slvdrog/3371801 to your computer and use it in GitHub Desktop.
Step 5
angular.module('Timeline', []).directive('ngTimeline', function() {
return function(scope, element, attr){
function updateTimeline(){
element.prepend(scope.$apply(attr.ngTimeline));
}
function asyncUpdateTimeline(){
setTimeout(function() {
updateTimeline();
asyncUpdateTimeline();
}, (1000 * parseInt(element.attr('data-refresh') || 1)));
}
asyncUpdateTimeline();
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment