Skip to content

Instantly share code, notes, and snippets.

View knvpk's full-sized avatar

Pavan kumar knvpk

View GitHub Profile
@knvpk
knvpk / controllers.js
Created October 15, 2015 17:18 — forked from jakemmarsh/controllers.js
AngularJS Service with Controller for access to Google API with Javascript Client (and RequireJS)
define(['angular', 'services'], function (angular) {
'use strict';
return angular.module('myApp.controllers', ['myApp.services'])
.controller('IndexCtrl', ['$scope', 'googleService', function ($scope, googleService) {
$scope.login = function () {
googleService.login().then(function (data) {
// do something with returned data
console.log(data.email);