Code Monkey home page Code Monkey logo

Comments (6)

pc035860 avatar pc035860 commented on August 18, 2024

Hi @lukasz-kaniowski ,

How about exposing an new API setInitFunction() in configuration state?

Usage example

app

.config(function ($FBProvider, $window) {

  var customInitFunction = function () {
    $window.Parse.FacebookUtils.init({
      appId      : 'YOUR_APP_ID', // Facebook App ID
      status     : true, // check login status
      cookie     : true, // enable cookies to allow Parse to access the session
      xfbml      : true  // parse XFBML
    });
  };

  // Using this API will override the $FBProvider.setInitParams configuration
  $FBProvider.setInitFunction(customInitFunction);

});

If you think this works for you, I'll open a new feature branch later for you to try it out.

from angular-easyfb.

lukasz-kaniowski avatar lukasz-kaniowski commented on August 18, 2024

Sounds like a good plan. Thanks.

On Monday, December 23, 2013, Robin Fan wrote:

Hi @lukasz-kaniowski https://github.com/lukasz-kaniowski ,

How about exposing an API in configuration state?

Usage example

app
.config(function ($FBProvider, $window) {

var customInitFunction = function () {
$window.Parse.FacebookUtils.init({
appId : 'YOUR_APP_ID', // Facebook App ID
status : true, // check login status
cookie : true, // enable cookies to allow Parse to access the session
xfbml : true // parse XFBML
});
};

// Using this API will override the $FBProvider.setInitParams configuration
$FBProvider.setInitFunction(customInitFunction);
});

If you think this works for you, I'll open a new feature branch later for
you to try it out.


Reply to this email directly or view it on GitHubhttps://github.com//issues/5#issuecomment-31104515
.

Lukasz Kaniowski
Connect with Me: http://www.linkedin.com/in/lukaszkaniowski
http://twitter.com/lkanio
http://lukaszkaniowski.com/ https://github.com/lukasz-kaniowski
https://github.com/lukasz-kaniowski
Contact Me: lukasz.kaniowski

from angular-easyfb.

pc035860 avatar pc035860 commented on August 18, 2024

@lukasz-kaniowski

I Just pushed a new branch feature/setInitFunction for the $FBProvider.setInitFunction.

The commit is here c32b9b4.

Please take a look and let me know how's it work.

Here's the example for Parse.com init. (I didn't test it)

app

.config(function ($FBProvider, $window) {

  /**
   * Custom init function is injectable
   */
  var customInitFunction = ['$window', '$fbInitParams', function ($window, $fbInitParams) {
    // You may access initParams via `$fbInitParams`:

    // $window.Parse.FacebookUtils.init($fbInitParams);

    // or just ignore it:
    $window.Parse.FacebookUtils.init({
      appId      : 'YOUR_APP_ID', // Facebook App ID
      status     : true, // check login status
      cookie     : true, // enable cookies to allow Parse to access the session
      xfbml      : true  // parse XFBML
    });
  }];

  $FBProvider.setInitFunction(customInitFunction);

});

from angular-easyfb.

lukasz-kaniowski avatar lukasz-kaniowski commented on August 18, 2024

It seems to work fine.
It is still require to setup appId via setInitParams though. Can you please change validation code to if (!_initParams.appId && !_initFunction) { at line 148.

from angular-easyfb.

pc035860 avatar pc035860 commented on August 18, 2024

I just pushed an update which have version 0.2.1 merged with a little modification.
Please give it a try.

from angular-easyfb.

lukasz-kaniowski avatar lukasz-kaniowski commented on August 18, 2024

It works fine. Thanks

from angular-easyfb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.