Created
January 31, 2018 14:09
-
-
Save TanmayDharmaraj/d795c7a37fabad86b51ffb290f16b6c7 to your computer and use it in GitHub Desktop.
http interceptor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (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