AngularJS directive to show the Facebook profile picture of the logged in user using UserApp.
Download and include the ua-facebook-picture.js
file in your index.html:
<script src="js/ua-facebook-picture.js"></script>
Then in app.js, add it to your app's dependencies:
angular.module('myApp', [..., 'UserApp', 'UserApp.facebook-picture']);
And last, in your templates, show the profile picture with the following code:
<img ua-facebook-picture>
Note: The directive caches the result from UserApp to save API calls.
Facebook allows you to get different sizes of the picture. Use the ua-facebook-picture
directive to specify which type you want. You can choose from these types: square
, small
, normal
, large
<img ua-facebook-picture="large">
You can also use the attributes width
and height
to specify the exact size in pixels.
<img ua-facebook-picture width="16" height="16">
Read more about it in Facebook's API Graph Reference.
Contact us via email at [email protected] or visit our support center. You can also see the UserApp documentation for more information.
MIT. See LICENSE.