Skip to content

Instantly share code, notes, and snippets.


Jake Marsh jakemmarsh

View GitHub Profile
jakemmarsh / directives.js
Created Jun 26, 2013
AngularJS directive to create a functional "back" button
View directives.js
app.directive('backButton', function(){
return {
restrict: 'A',
link: function(scope, element, attrs) {
element.bind('click', goBack);
function goBack() {
jakemmarsh / controllers.js
Last active May 20, 2019
AngularJS Service with Controller for access to Google API with Javascript Client (and RequireJS)
View controllers.js
define(['angular', 'services'], function (angular) {
'use strict';
return angular.module('myApp.controllers', [''])
.controller('IndexCtrl', ['$scope', 'googleService', function ($scope, googleService) {
$scope.login = function () {
googleService.login().then(function (data) {
// do something with returned data