Skip to content

Instantly share code, notes, and snippets.

Avatar

Dejan Ćebetarević cebence

  • Novi Sad, Vojvodina, Serbia
View GitHub Profile
@idosela
idosela / http-response-interceptor.js
Last active Sep 9, 2020
Sample code for ng-conf 2014
View http-response-interceptor.js
angular.module('myMdl', []).config(['$httpProvider', function($httpProvider) {
$httpProvider.responseInterceptors.push([
'$q', '$templateCache', 'activeProfile',
function($q, $templateCache, activeProfile) {
// Keep track which HTML templates have already been modified.
var modifiedTemplates = {};
// Tests if there are any keep/omit attributes.
var HAS_FLAGS_EXP = /data-(keep|omit)/;