Search Posts

Category: facebook

ngFacebook does not load work in angular and throws "can’t load URL" error

My code is as shown below: app.js angular.module(‘quflipMobWeb’, [ ‘quflipMobWeb.services’, ‘quflipMobWeb.controllers’, ‘quflipMobWeb.login’, ‘quflipMobWeb.homeController’, ‘ngRoute’, ‘ngFacebook’ ]). config([‘$routeProvider’, ‘$locationProvider’, ‘$facebookProvider’, function($routeProvider, $locationProvider, $facebookProvider) { $routeProvider. when(“/home”, { templateUrl: “template/home.html”, controller: “homeController” }). when(“/login”, { templateUrl: “template/login.html”, controller: “loginController” }). otherwise({ redirectTo: ‘/login’ }); $facebookProvider.setAppId(‘id’).setPermissions([’email’, ‘user_friends’]); }]) .run([‘$rootScope’, ‘$window’, function($rootScope, $window) { (function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = “//connect.facebook.net/en_US/sdk.js”; fjs.parentNode.insertBefore(js, fjs); }(document, ‘script’, […]