how to properly inject Facebook JavaScript SDK to AngularJS controllers?

后端 未结 5 1790
一整个雨季
一整个雨季 2021-02-02 14:01

I\'m new to AnuglarJS and already built a small web-app with it, I would like to use the Facebook JavaScript SDK with it, but using best practices (dependency injecting to contr

5条回答
  •  隐瞒了意图╮
    2021-02-02 14:38

    I have written this angularjs-facebook service. First you init it on your app module config method to initialize your facebook app id and other settings.

    Then you just enjoy calling the Facebook service from Controllers and calling Facebook methods asynchronous just as normal.

    https://github.com/ciul/angularjs-facebook

提交回复
热议问题