angular-openfb

OpenFB module for AngularJS Apps

Added by: Sam Deering

GitHub

Repository

lnmunhoz/angular-openfb

Stats

Stars: 3

Watchers: 3

Forks: 0

Module Description

angular-openfb

OpenFB module for AngularJS Apps

$ bower install angular-openfb

Setup

angular.module('myApp', ['openfb'])
.run(function (OpenFB) {
  
  OpenFB.init('YOUR_FB_APP_ID');

});

Examples

Getting user information

angular.module('myApp')
.controller('ProfileCtrl', function ($scope, OpenFB) {
    OpenFB.get('/me').success(function (user) {
        $scope.user = user;
    });
});

Login

angular.module('myApp')
.controller('LoginCtrl', function ($scope, $location, OpenFB) {

    $scope.facebookLogin = function () {

        OpenFB.login('email,read_stream,publish_stream').then(
            function () {
                $location.path('/app/dashboard');
            },
            function () {
                alert('OpenFB login failed');
            });
    };

});

Author

Created by ccoenraets

License

MIT License © Lucas N. Munhoz

Module stats last updated: 2015-05-27 01:21:21

Disclaimer: Some data on this page may have been gathered from the authors GitHub respository. If you see any mistakes or outdated information please let us know. Thanks!