how to implement google+ sign-in with angularjs

Viewed 16438

I have an AngularJS app, and I want to implement G+ sign-in. I've gone through their samples, and they work as standalone apps.

https://developers.google.com/+/web/signin/

In my Angular app, I am able to display the G+ sign-in button. But I'm stuck on the callback. Do I put the callback function in my controller js file?

If so, and given this controller:

app.controller('myController', function ($scope) {
    function signinCallback(authResult) {

On my data-callback, how do I name it so that it goes to signinCallback inside myController?

    <span id="signinButton">
      <span
        class="g-signin"
        data-callback="signinCallback"
        data-clientid="123456789.apps.googleusercontent.com"
        data-cookiepolicy="single_host_origin"
        data-requestvisibleactions="http://schemas.google.com/AddActivity"
        data-scope="https://www.googleapis.com/auth/plus.login https://www.googleapis.com/auth/plus.profile.emails.read"
      </span>
    </span>
3 Answers
Related