Skip to content

Instantly share code, notes, and snippets.

@ryrych
Last active December 20, 2015 14:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save ryrych/6145566 to your computer and use it in GitHub Desktop.
Save ryrych/6145566 to your computer and use it in GitHub Desktop.
Ember.js Gravatar Component. Original version: http://plnkr.co/edit/QbhyrcXZ6LbGzVFfEzD4 by cavneb with further changes.
{{gravatar-image email="cavneb@gmail.com"}}
<img {{bindAttr src=gravatarUrl}}>
App.GravatarImageComponent = Ember.Component.extend
tagName: ''
email: ''
size: 200
gravatarUrl: (->
email = @get 'email'
size = @get 'size'
"http://www.gravatar.com/avatar/#{MD5(@get 'email')}#{?s=@get('size')}"
).property('email', 'size')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment