Skip to content

Instantly share code, notes, and snippets.

View jonathanjacob's full-sized avatar

Jonathan Jacob jonathanjacob

View GitHub Profile
@jonathanjacob
jonathanjacob / chrome-angular.js
Created May 23, 2016 23:48 — forked from mgol/chrome-angularjs.js
Chrome DevTools Snippet for Angular apps.
var ngAppElem = angular.element(document.querySelector('[ng-app]') || document);
window.$injector = ngAppElem.injector();
window.inject = $injector.invoke;
window.$rootScope = ngAppElem.scope();
// getService('auth') will create a variable `auth` assigned to the service `auth`.
var getService = serviceName =>
inject([serviceName, s => window[serviceName] = s]);