Ensure template cachebuster interceptor is only pushed on local environments

This commit is contained in:
Adam Lavin 2015-12-16 13:07:03 +00:00
parent f01fcae3af
commit f09d75cf76

View file

@ -29,13 +29,14 @@ module.config [
'$locationProvider', '$stateProvider', '$dialogProvider', 'AngularyticsProvider', '$httpProvider', '$sceDelegateProvider' '$locationProvider', '$stateProvider', '$dialogProvider', 'AngularyticsProvider', '$httpProvider', '$sceDelegateProvider'
(location, state, $dialogProvider, analytics, $httpProvider, $sceDelegateProvider) -> (location, state, $dialogProvider, analytics, $httpProvider, $sceDelegateProvider) ->
$httpProvider.interceptors.push [ if window.pfm.environment == 'local'
-> $httpProvider.interceptors.push [
request: (config) -> ->
return config if !(/^\/?templates\//.test config.url) request: (config) ->
config.url += '?' + Math.ceil(Math.random() * 1000000) return config if !(/^\/?templates\//.test config.url)
return config config.url += '?' + Math.ceil(Math.random() * 1000000)
] return config
]
# This fixes resource loading on IE # This fixes resource loading on IE
$sceDelegateProvider.resourceUrlWhitelist [ $sceDelegateProvider.resourceUrlWhitelist [