Support for dev environment
Closed this issue · 2 comments
rycastaneda commented
can we have a setting for multiple environments such as dev, production etc?
JanStevens commented
So you want to switch global config based on an environment? How would you define your environment in your code? Care to share a example (so I know what your asking for specifically?)
rycastaneda commented
Well I have a constant in my angular module which goes something like this
(function () {
'use strict';
angular
.module('myapp', modules)
.constant('environment', my_env)
.config(['growlProvider', '$httpProvider', growler])
})();
I think just on the http interceptor would be fine though.
Well I guess you could just do something like this
(function () {
angular
.module('myapp', modules)
.constant('environment', my_env)
.config(['growlProvider', '$httpProvider', 'environment', growler])
function growler (growlProvider, $httpProvider, environment) {
if (environment === 'dev'){
$httpProvider.interceptors.push(['$q','growl', '$rootScope', '$interpolate', '$filter', interceptor]);
}
}
})();
so nevermind. Thanks for the hardwork.