Skip to content

Instantly share code, notes, and snippets.

View jonathanjacob's full-sized avatar

Jonathan Jacob jonathanjacob

View GitHub Profile
@jonathanjacob
jonathanjacob / client_script.js
Last active May 5, 2019 16:35
Service Portal Impersonation
//Be sure and include spModal in the function
function ($rootScope, $scope, snRecordWatcher, spUtil, spModal, $location, $uibModal, cabrillo, $timeout) {
//Impersonation
$scope.openImpersonationDialog = function(){
spModal.open({
title: "Impersonate User",
widget: "service-catalyst-impersonate",
buttons: [
{label:'Close', cancel: true}
@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]);