Skip to Main Content
AngularJS Web Application Development Blueprints
book

AngularJS Web Application Development Blueprints

by Vinci J Rufus
August 2014
Intermediate to advanced content levelIntermediate to advanced
300 pages
6h 9m
English
Packt Publishing
Content preview from AngularJS Web Application Development Blueprints

Getting your friends' profile pictures and birthdays

As of now, we are only displaying the names of our friends; we now need to display their profile picture and their birthdays (if they have updated it on their Facebook profile) too.

By using the Graph Explorer, you'll see that the endpoint that we need to call to get the required information is /me/friends?fields=birthday,name,picture.

Let's update the endpoint in our directive controller function by adding the following highlighted code. We make this change in the app/directives.js file, shown as follows:

$scope.loadFriends = function() {

  FB.api('/me/friends?fields=birthday,name,picture', function(response) {
    $scope.$apply(function() {
      $scope.myFriends = response.data;
    });

  });
}

We'll also need ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

AngularJS: Maintaining Web Applications

AngularJS: Maintaining Web Applications

Rodrigo Branas, Chandermani, Matt Frisbie, Amos Q. Haviv
AngularJS

AngularJS

Shyam Seshadri, Brad Green
Professional AngularJS

Professional AngularJS

Valeri Karpov, Diego Netto
Pro AngularJS

Pro AngularJS

Adam Freeman

Publisher Resources

ISBN: 9781783285617Supplemental Content