Skip to content
This repository has been archived by the owner on Jan 8, 2019. It is now read-only.
/ angular-fbxnd Public archive

Angular 1.x bindings for JavaScript Facebook SDK

License

Notifications You must be signed in to change notification settings

joseluisq/angular-fbxnd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

angular-fbxnd

Angular 1.x bindings for JavaScript Facebook SDK

Install

bower install angular-fbxnd --save

Usage

angular
  .module('myapp.register', [
    'fbxnd'
  ])

  // Inject the `FBXnd` factory
  .controller('RegisterCtrl', function (FBXnd) {
    var app = this

    // Configuration
    var fb = FBXnd({
      appId: 777777770000000,
      xfbml: true,
      status: true,
      version: 'v2.3',
      lang: 'es_ES', // JSDK lang (en_EN, fr_FR, etc)
      injectJSDK: true // Inject the JSDK script into DOM automatically
    })

    // Inject the JSDK into DOM and return a Promise object then it's loaded
    fb.load()
      .then(function () {
        console.log('Loaded!')
      })

    // This a custom app function
    app.onFacebookConnect = function () {

      // Connect function calls `getStatusInfo()`, `login()` and `getProfile()` for you
      // and return a Promise object
      fb.connect()
        .then(function (res) {
          // OK
          console.info(res)
        }, function (res) {
          // ERROR
          console.error(res)
        })

    }
  })

License

MIT license

© 2016 José Luis Quintana

About

Angular 1.x bindings for JavaScript Facebook SDK

Resources

License

Stars

Watchers

Forks

Packages

No packages published