Sunday, 11 August 2013

$log (or other services inside AngularJS directives)

$log (or other services inside AngularJS directives)

I have the following directive I use to initialize the timeago plugin.
Directives.directive('timeago', function() {
return function(scope, element, attrs) {
$(element).attr('title', scope.post.utc_posted);
$(element).timeago();
}
});
How could I use/pass $log inside the function I'm returning?

No comments:

Post a Comment