Created
October 20, 2016 10:27
-
-
Save maxca/a0fcd4beaedf24a3181d1dfc46002f34 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** main controller */ | |
| (function(){ | |
| var mainController = angular.module('mainController', ['moduleConfig','facebookFactory','serviceLocalStorage']); | |
| mainController.controller('mainController', ['$scope', '$window', 'config','facebook','localStorage', | |
| function($scope, $window ,config,facebook,localStorage) { | |
| console.log(config); | |
| facebook.checkConnect().then(function(status){ | |
| /** case already authen */ | |
| console.log(status); | |
| console.log(facebook.getProfile()); | |
| facebook.getProfile().then(function(data){ | |
| $scope.profile = data; | |
| localStorage.set('profile',angular.toJson(data)); | |
| }); | |
| },function(err){ | |
| console.log(error); | |
| }); | |
| }]); | |
| }()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment