Coder Social home page Coder Social logo

nggapi's Introduction

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>

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()

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.