angular-google-plus
![Bower version](https://badge.fury.io/bo/angular-google-plus.svg)
A angular module which handles the login with the Google+ API
Demo
Try this demo. Remind that there is no API Key
and Client ID
inserted
Install
Install the angular module with bower.
$ bower install angular-google-plus
Usage
var app = angular.module('app', ['googleplus']);
app.config(['GooglePlusProvider', function(GooglePlusProvider) {
GooglePlusProvider.init({
clientId: 'YOUR_CLIENT_ID',
apiKey: 'YOUR_API_KEY'
});
}]);
app.controller('AuthCtrl', ['$scope', 'GooglePlus', function ($scope, GooglePlus) {
$scope.login = function () {
GooglePlus.login().then(function (authResult) {
console.log(authResult);
GooglePlus.getUser().then(function (user) {
console.log(user);
});
}, function (err) {
console.log(err);
});
};
}]);
Credits
0.1.2
- Bower: remove minifed version from main value
- Dependencies: remove connect dependency (Gruntfile)
- API: Add the getUser method and remove it from login (#1, #4)
Breaking Changes
The API for login has been changed (#4):
Before:
GooglePlus.login().then(function (user) {
console.log(user);
}, function (err) {
console.log(err);
});
After:
GooglePlus.login().then(function (authResult) {
console.log(authResult);
GooglePlus.getUser().then(function (user) {
console.log(user);
});
}, function (err) {
console.log(err);
});