-1

How to authenticate angular single page web application with angular facebook sdk that would work with angular ui router where the $stateProvider would check and remember user facebook status, would redirect to facebook login when user needs to authenticate to access the selected view ? How to save facebook status in angular ui controller and later check if the user status without calling facebook ?

2
  • where is your code? where exactly are you stuck? Commented Nov 24, 2016 at 16:29
  • I am stuck how to make angular ui router stateProvider recognize what is the state of a user without needing to get the status or call login from facebook when the user status has already done that already. Commented Nov 25, 2016 at 17:24

1 Answer 1

1

Yes you can do that, create app with the view and controller defined for the facebook.

var myApp = angular.module('myApp', ['ui.router'])
myApp.config(function($stateProvider, $urlRouterProvider) {
  $urlRouterProvider.when("", "/facebook");
  $stateProvider
    .state("facebook", {
      url: "/facebook",
      templateUrl: "facebook.html",
      controller: 'facebooktrl'

    });
});

You need to use the fbSDK as mentioned in the developers document and configure the redirect url too.

Here is a DEMO application

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.