Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReferenceError: facebookUser is not defined #20

Open
jokeMF opened this issue Apr 28, 2016 · 0 comments
Open

ReferenceError: facebookUser is not defined #20

jokeMF opened this issue Apr 28, 2016 · 0 comments

Comments

@jokeMF
Copy link

jokeMF commented Apr 28, 2016

Hi,

I keep getting the above mentioned error

angular.js:12520 ReferenceError: facebookUser is not defined

on the line in the eventlistener where I call facebookUser.

$rootScope.$on('fbLoginSuccess', function(name, response) {
facebookUser.then(function(user) {
user.api('/me').then(function(response) {
console.log(response);
if (response.status === 'connected') {
// Logged into your app and Facebook.
$scope.facebooklogin(response.id);
} else if (response.status === 'not_authorized') {
// The person is logged into Facebook, but not your app.
$("#loginWarning").innerHTML = 'Please log ' +
'into this app.';
} else {
// The person is not logged into Facebook, so we're not sure if
// they are logged into this app or not.
$("#loginWarning").innerHTML = 'Please log ' +
'into Facebook.';
}
});
});
});

I link facebookUtils.js after angular and before my app.
This is how I inject the dependancy:

var myApp = angular.module('myApp', ['facebookUtils', 'ngRoute', 'ngSanitize']);
myApp.constant('facebookConfigSettings', {
'appID' : 'myappId'
});

What am I doing wrong? Am I doing anything wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant