Skip to content

Instantly share code, notes, and snippets.

@waynehoover
Created December 3, 2012 17:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save waynehoover/4196380 to your computer and use it in GitHub Desktop.
Save waynehoover/4196380 to your computer and use it in GitHub Desktop.
DOM:
<div ng-repeat="post in posts">
...
abbr.created-at.arial.timeago title="{{post.created_at}}"
</div>
Script:
.directive('postTile', function($timeout){
return{
restrict: 'A',
require: '?ngModel',
link: function(scope, el, attrs, ngModel){
$timeout(function(){
//do these jquery methods on specific items of element's children
$(el).find(".timeago").timeago();
$(el).find(".post-add-comment").expandingTextarea({
$(el).find(".desc, .hyve-desc").ellipsis();
})
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment