Problem related to FB API and AngularJS (number of likes)

angularjs

#1

Hello, I've got a problem related to FB API, JS and Angular. I've got some part of code in index.html and I wrote another part of code in file called script.js. There should be 2 functions: first - visibility of buton, second - sending and getting data from Facebook (number of likes and name of profil):
http://plnkr.co/edit/G80gClkiLGr9ZxJpN2sp?p=preview
There're no problems with the first, but I have no idea why the second doesn't work. Any ideas? What is wrong?


#2

You need to bind Angular properties (like ctrl) to $scope, otherwise you can't use them in your index.html


#3

I was trying in this way, but it wasn't work (maybe I did something wrong...).


#4

You started your <head> twice as well (just after your <html> is the first one). You should remove the second one.


#5

Okay. I did it. But it doesn't make any diffrence.


#6

About the facebook api. Where are you reading about it? I haven't used this one in particular. Are you following the instructions correctly?


#7

I read:
https://developers.facebook.com/docs/graph-api/using-graph-api
https://developers.facebook.com/docs/graph-api/reference/v2.3/object/likes

To be onest, I'm not sure if I do it correctly. It seems to me that's OK.


#8

Try this one instead: https://developers.facebook.com/docs/javascript/howto/angularjs