Skip to content

aziz/angular-directive.g-signin

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Angular Google Plus Sign-in Button Directive

Homepage

A good starting place for a Google Plus sign-in button. Specify your client id and you're done. Well, almost. You'll also want a signinCallback() function so you can do something once your users are authenticated.

Usage

  1. Include google-plus-signin.js.
  2. Add directive.g+signin as a dependency to your app.
  3. Add <g+signin clientid="your-client-id"> to your app.
  4. Create a signinCallback() function to detect when your users are authenticated.

Example

See the homepage for an example.

<div ng-app="directive.g+signin">
  <g+signin clientid="620125449078"></g+signin>
  <p>^ This is a Google Plus sign-in button</p>
</div>
  // Callback for Google+ Sign-In
  function signinCallback(authResult) {

    console.log(authResult);
    if (authResult['access_token']) {
      // User successfully authorized the G+ App!

    } else if (authResult['error']) {
      // User has not authorized the G+ App!
    }
  } 

License

♡ CopyHeart 2013 by Jerad Bitner | Copying is an act of love. Please copy.

About

AngularJS Directive for Google Plus Sign-in Button

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%