angularjs - Angular controller scope variable not updated -


hello have code permit signin via social networks :

i have html page wich call facebooksubscrib, googleplussubscribe function on click, works :

kecooapp.controller('homectrl', ['$scope', '$rootscope', 'configuration',  '$state', '$modal',     function ($scope, $rootscope, configuration, $state, $modal) {      }  ]);     kecooapp.controller('signupctrl', ['$scope', '$rootscope', 'configuration', '$state', '$modal', 'facebook', 'googleplus', 'linkedin',               '$state',      function ($scope, $rootscope, configuration, $state, $modal, facebook, googleplus, linkedin, $state) {            $scope.rsuserinfo = {};           $scope.check =  function() {              console.log($scope.rsuserinfo);          }            $scope.rsuserinfoparse = function(provider,data) {               switch(provider) {                  case "facebook":                      break;                  case "google":                      console.log(data);                      rsuserinfo={};                      rsuserinfo.lastname=data.family_name;                      rsuserinfo.firstname=data.given_name;                      return(rsuserinfo);                      break;                  case "linkedin":                      break;                  case "twitter":                      break;               }             }            $scope.facebooksubscribe = function () {              // on can use facebook service facebook api says              facebook.getloginstatus(function (response) {                  if (response.status === 'connected') {                      $scope.fbloggedin = true;                      facebook.api('/me', function (response) {                          $scope.user = response;                          $scope.rsuserinfo=$scope.rsuserinfoparse("facebook",response);                      });                  } else {                      $scope.fbloggedin = false;                      facebook.login(function (response) {                          facebook.api('/me', function (response) {                              $scope.user = response;                                   $scope.rsuserinfo=$scope.rsuserinfoparse("facebook",response);                          });                      });                  }              });              $state.go('app.signup-step1');          };           $scope.googleplussubscribe = function () {              googleplus.login().then(function (authresult) {                  googleplus.getuser().then(function (user) {                                          console.log($scope.rsuserinfoparse("google",user,$scope.rsuserinfo));                      $state.go('app.signup-step1');                  });              }, function (err) {              });           };            $scope.linkedinsubscribe = function () {              data = linkedin.authorizelinkedin();                   $scope.rsuserinfo=$scope.rsuserinfoparse("linkedin",data);          }           $scope.twittersubscribe = function () {              digits.login()                      .done($scope.twittersuccess) /*handle response*/                      .fail();              $state.go('app.signup-step1');          }           $scope.twittersuccess = function (reponse) {              $scope.rsuserinfo$scope.rsuserinfoparse("twitter",response);              $state.go('app.signup-step1');          }        }  ]); 

when googleplussubscribe fired function called rsuserinfo (in google section onf rsuserinfoparse) setted $scope.rsuserinfo empty.

does can me ?


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -