Skip to content

Instantly share code, notes, and snippets.

@TanmayDharmaraj
Created January 31, 2018 14:09
Show Gist options
  • Save TanmayDharmaraj/d795c7a37fabad86b51ffb290f16b6c7 to your computer and use it in GitHub Desktop.
Save TanmayDharmaraj/d795c7a37fabad86b51ffb290f16b6c7 to your computer and use it in GitHub Desktop.
http interceptor
(function (angular) {
angular.module('my')
.factory('customHttpInterceptor', ['HTML', function (html) {
return {
request: function (config) {
if (config.url.indexOf('views/') > 0) {
if(config.url.indexOf('deployments-history/history.html') > 0){
console.log("called history");
}
var key = config.url.replace("Scripts/dist/", "")
config.url = "Scripts/dist/" + html[key];
return config
}
return config;
}
}
}]);
})(window.angular);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment