• Stars
    star
    113
  • Rank 310,115 (Top 7 %)
  • Language
    CoffeeScript
  • License
    MIT License
  • Created over 11 years ago
  • Updated over 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

AngularJS Google API Client

ngGAPI

ngGAPI is a Google APIs client for AngularJS.

Status

Currently Youtube, Google+, Google Calendar, and parts of Blogger and Google Drive are implemented. I'm working (as of 10/20/2013) in my spare time to support the rest of the APIs. Erik Isaksen is helping with this and an example app. Glad to spend some time pair programming with anyone else that wants to contribute. If you want to use ngGAPI but something is missing or doesn't work as expected, please submit an issue, or better yet a pull request. Thanks in advance!

Install

Bower is the quickest way to include ngGAPI in your project.

$ bower install https://github.com/christiansmith/ngGAPI.git --save

<script src="bower_components/ngGAPI/gapi.js"></script>

If you don't use Bower, just download gapi.js into your scripts directory.

$ curl -O https://raw.github.com/christiansmith/ngGAPI/master/gapi.js

<script src="your/js/path/gapi.js"></script>

ngGAPI requires Google API JavaScript client library

<script src="https://apis.google.com/js/client.js"></script>

Usage

Be sure to include "gapi" as a dependency in your main app module.

angular.module('myApp', ['gapi'])

After you register your app in the Google APIs Console, configure ngGAPI with credentials and whatever scopes you need for your app.

angular.module('myApp')
  .value('GoogleApp', {
    apiKey: 'YOUR_API_KEY',
    clientId: 'YOUR_CLIENT_ID',
    scopes: [
      // whatever scopes you need for your app, for example:
      'https://www.googleapis.com/auth/drive',
      'https://www.googleapis.com/auth/youtube',
      'https://www.googleapis.com/auth/userinfo.profile'
      // ...
    ]
  })

To use a specific service, inject it into your controllers by name. All GAPI methods return a promise.

angular.module('myApp')
  .controller('VideosCtrl', function ($scope, Youtube) {
    $scope.videos = Youtube.search({ part: 'snippet', q: 'Search terms' })
  });

Services

GAPI authorization

  • GAPI.init()

Admin Directory::users

Admin Directory::groups

Drive

Youtube

Official Youtube DATA API (v3) reference documentation

Google+

Calendar API

Development

Installing the Karma test runner with npm install karma -g, then run the tests with karma start.

Copyright and License

The library is Copyright (c) 2013 Christian Smith, and distributed under the MIT License.

More Repositories

1

ngDropbox

AngularJS Dropbox Client
JavaScript
66
star
2

golang-algorithms

Notebook of algorithms examples in Go
Go
24
star
3

OAuth2Server

OAuth 2.0 Provider
CoffeeScript
19
star
4

ngOAuthExamples

JavaScript
11
star
5

clojurize-protocol

The Clojurize Protocol
Clojure
9
star
6

clojurize-sql

Experimental Clojurize SQL Adapter
Clojure
6
star
7

notch

Notch is a command line tool and library for building, deploying and administering CouchApps with Node.js.
JavaScript
5
star
8

clojurize-couchdb

Experimental Clojurize CouchDB Adapter
Clojure
5
star
9

modulo

Modulo helps you compose large, maintainable Express applications from smaller, discreet, reusable apps.
JavaScript
4
star
10

OAuth2Resource

Middleware for authorizing access to protected resources via OAuth2Server
JavaScript
4
star
11

milonga

Milonga is a helper for defining a set of RESTful Express routes based on Modinha models.
JavaScript
3
star
12

mongoose-statemachine

State machine plugin for the Mongoose ODM
CoffeeScript
3
star
13

clojurize-adapter

Clojurize Adapter Starter Kit
Clojure
3
star
14

norq

A loosely-ordered random-access queue for JSON documents implemented with Node and Redis.
JavaScript
2
star
15

OAuth2Admin

JavaScript
2
star
16

javascriptworkshop

Notes and examples from 2/23/2013 JavaScript workshop
2
star
17

kaizen

Vim Script
1
star
18

dnormalizr

Dnormalizr creates object heirarchies from normalized data.
JavaScript
1
star
19

chef-repo

Ruby
1
star
20

anvil-connect-nodejs-api-example

Example using Anvil Connect to protect an Node.js API
JavaScript
1
star
21

hekyll

Hekyll is a CouchApp blog inspired by jekyll and built with Notch.
JavaScript
1
star