Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
angular-facebook-factory
Advanced tools
Facebook factory for AngularJS 1.x
angular
.module('app', ['ngFacebook'])
.controller('AppController', ['$scope','FacebookFactory',function($scope,FacebookFactory) {
FacebookFactory.setLang('pt_BR') // set lang
FacebookFactory.init({
appId: 'appId', // required, default = null
status: true, // optional, default = true
cookie: false, // optional, default = false
xfbml: false, // optional, default = false
version: 'v2.8' // optional, default = v2.4
})
}])
angular
.module('app')
.service('FacebookService', ['$http','FacebookFactory',function($http,FacebookFactory) {
var service = {
me: me,
auth: auth,
logout: logout,
disconnect: disconnect,
share: share
}
return service
function me(callback) {
FacebookFactory.api('/me', {
fields: 'name,email,gender,birthday'
}, function(response) {
callback(response)
})
}
function auth(callback) {
FacebookFactory.getLoginStatus(function(response) {
if (response.status === 'connected') {
callback(response)
} else {
FacebookFactory.login(function(response) {
if (response.status === 'connected') {
callback(response)
}
}, {
scope: 'public_profile,email,user_birthday'
})
}
})
}
function logout(callback) {
FacebookFactory.logout(function(response) {
callback(response)
})
}
function disconnect(callback) {
FacebookFactory.disconnect(function(response) {
callback(response)
})
}
function share(params, callback) {
var obj = {
method: 'share',
mobile_iframe: true
}
FacebookFactory.ui(
Object.assign(obj, params),
function(response) {
callback(response)
}
)
}
}])
angular
.module('app')
.controller('AuthController', ['$scope','FacebookFactory','FacebookService',function($scope,FacebookFactory,FacebookService) {
$scope.getAuth = function(callback) {
FacebookService.auth(function(response) {
$scope.token = response.authResponse.accessToken // Get token
FacebookService.me(function(response) {
// Response handling
})
})
}
$scope.logout = function() {
FacebookService.logout(function(response) {
// Response handling
})
}
$scope.disconnect = function() {
FacebookService.disconnect(function(response) {
// Response handling
})
}
$scope.share = function() {
FacebookService.share({
href: 'http://guiseek.js.org/angular-facebook-factory',
title: 'Angular Facebook Factory',
description: 'Facebook factory for AngularJS 1.x'
}, function(response) {
// Response handling
})
}
}])
Version | Description |
---|---|
1.1.0 | Support FB.ui to share and enhacement tasksSupports FB.ui for sharing and enhancements in npm tasks |
1.0.2 | Method setLang on factory and better documentation |
Command | Description |
---|---|
npm start | Watch and open live server |
npm run watch | Concat, babelify, minify and watch |
npm run build | Concat, babelify and Minify |
FAQs
Facebook factory for AngularJS 1.x
The npm package angular-facebook-factory receives a total of 1 weekly downloads. As such, angular-facebook-factory popularity was classified as not popular.
We found that angular-facebook-factory demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.