I am doing a registration form where I call the facebook API get some data and fill my form with the data needed. I am doing smth like this in my controller:
$scope.fbRegister = function () {
facebookConnectPlugin.getLoginStatus(function (success) {
if (!cordova) {
//this is for browser only
facebookConnectPlugin.browserInit(FACEBOOK_APP_ID);
}
alert(JSON.stringify(success, null, 3));
if (success.status === 'connected') {
// the user is logged in and has authenticated your app, and response.authResponse supplies
// the user's ID, a valid access token, a signed request, and the time the access token
// and signed request each expire
facebookConnectPlugin.api("me/?fields=id,first_name,last_name,link,gender,email,birthday", ["public_profile", "email", "user_birthday"],
function(result) {
alert("Result: " + JSON.stringify(result));
alert(result.first_name);
$scope.formData = {
name: result.first_name,
password: "",
confirmPassword: "",
email: '',
};
})
}
However I don't get the prefiled data in name: result.first_name,
.
I make an alert for that and I get the data but I cant get it fill the form.
Thank you