Using Facebook SDK as an Angular service

720 views
Skip to first unread message

Brad

unread,
Sep 19, 2012, 2:20:48 PM9/19/12
to ang...@googlegroups.com
I have Facebook working pretty well with Angular except for one case. When the user logs in the first time the view doesn't update. This same problem happens when the user tries to logout; view doesn't update. It seems like it is something with the data binding, but I'm still a bit unfamiliar with the details to debug this further. Take a look at this simple jsFiddle and let me know if you see anything I'm doing wrong.

http://jsfiddle.net/bradbirdsall/ggmRQ/

Thanks :)

ProLoser

unread,
Sep 19, 2012, 2:34:03 PM9/19/12
to ang...@googlegroups.com

Brad Birdsall

unread,
Sep 19, 2012, 2:49:31 PM9/19/12
to ang...@googlegroups.com
I seem to be getting errors when trying to do this within my Facebook service. How would I do this in a service?

B

Peter Bacon Darwin

unread,
Sep 20, 2012, 8:36:54 AM9/20/12
to ang...@googlegroups.com
This any help?
Pete

--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To post to this group, send email to ang...@googlegroups.com.
To unsubscribe from this group, send email to angular+u...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular?hl=en.
 
 

br...@builtbyprime.com

unread,
Sep 20, 2012, 6:27:15 PM9/20/12
to ang...@googlegroups.com
I think I solved everything I was trying to do:


B

brian....@gmail.com

unread,
Nov 21, 2012, 4:14:10 PM11/21/12
to ang...@googlegroups.com, br...@builtbyprime.com
I've tried this and it works very well.

I've also tried to find out whether or not the user is already logged in, when entering the page. I've had several attempts on this, but I can't figure out how to do it. It seems that the facebook api scripts aren't available on page load, which is why I can't check the current login status.

How would you go about building a getLoginStatus-check into the solution you've posted, so that the username is shown in stead of the login button, when the user is already authenticated?

/Brian
Reply all
Reply to author
Forward
0 new messages