NgGAPI
AngularJS Google API Client
Install / Use
/learn @christiansmith/NgGAPIREADME
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
- Users
Admin Directory::groups
- Users
Drive
-
Files
- Drive.getFiles(fileId, params)
- Drive.insertFiles(data, params)
- Drive.patchFiles(fileId, data, params)
- Drive.updateFiles(fileId, data, params)
- Drive.copyFiles(fileId, data, params)
- Drive.deleteFiles(fileId)
- Drive.listFiles(params)
- Drive.touchFiles(fileId)
- Drive.trashFiles(fileId)
- Drive.untrashFiles(fileId)
- Drive.watchFiles(fileId, data)
-
About
-
Changes
-
Children
-
Parents
-
Permissions
- Drive.deletePermissions(fileId, permissionId)
- Drive.getPermissions(fileId, permissionId)
- Drive.insertPermissions(fileId, data, params)
- Drive.listPermissions(fileId)
- Drive.patchPermissions(fileId, permissionId, data, params)
- Drive.updatePermissions(fileId, permissionId, data, params)
- Drive.getPermissionIdForEmail(email)
-
Revisions
-
Apps
-
Comments
-
Replies
-
Properties
- Drive.deleteProperties(fileId, propertyKey)
- [Drive.getProperties(fileId, propertyKey)](https://developers.google.com/dri
Related Skills
node-connect
349.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
109.5kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
349.2kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
349.2kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
