forked from sirkitree/angular-directive.g-signin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
70 lines (57 loc) · 2.63 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
<title>AngularJS Google Plus Sign-in Button Directive</title>
<meta name="description" content="A directive for AngularJS to provide a Google Plus Sigin-in Button">
<link href="//netdna.bootstrapcdn.com/bootswatch/2.3.0/cerulean/bootstrap.min.css" rel="stylesheet">
</head>
<body class="container">
<h1>Angular Google Plus Sign-in Directive</h1>
<hr>
<h2>Usage</h2>
<div class="row">
<div class="span12">
<ol>
<li>Include <code>google-plus-signin.js</code>.</li>
<li>Add <code>directive.g+signin</code> as a dependency to your app.</li>
<li>Add <code><google-plus-signin clientid="your-client-id"></code>s.</li>
<li>Create a <code>signinCallback()</code> function to detect successful authentication. <em>Sample in the <a href="https://github.com/sirkitree/angular-directive.g-signin#example">README</a>.</li>
</ol>
</div>
</div>
<hr>
<h2>In action</h2>
<div class="row">
<div class="span6">
<div ng-app="directive.g+signin">
<google-plus-signin clientid="620125449078-4jo21sf1ltlb81o5cbke4sic3ogoo3gm"></google-plus-signin>
<p>^ This is a Google Plus sign-in button</p>
</div>
</div>
<div class="span6">
<div class="highlight"><pre><span class="nt"><div</span> <span class="na">ng-app=</span><span class="s">"directive.g+signin"</span><span class="nt">></span>
<span class="nt"><google-plus-signin</span> <span class="na">clientid=</span><span class="s">"620125449078"</span><span class="nt">></google-plus-signin></span>
<span class="nt"><p></span>^ This is a Google Plus sign-in button<span class="nt"></p></span>
<span class="nt"></div></span>
</pre></div>
</div>
</div>
<hr>
<a href="https://github.com/sirkitree/angular-directive.g-signin"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_orange_ff7600.png" alt="Fork me on GitHub"></a>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.0.6/angular.min.js"></script>
<script src="google-plus-signin.js"></script>
<script>
// 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!
}
}
</script>
</body>
</html>