my config.json file with multiple environments:
{
"local": {
"EnvironmentConfig": {
"api": "http://localhost/"
}
},
"production": {
"EnvironmentConfig": {
"api": "https://api.production.com/"
}
}
}
Usage of the plugin:
gulpNgConfig('myApp.config', {
environment: 'production'
})
Expected output:
angular.module('myApp.config', [])
.constant('EnvironmentConfig', {"api": "https://api.production.com/"});
But my output configFile.js:
angular.module("todoApp.config", [])
.constant("local", {"EnvironmentConfig":{"api":"http://localhost/"}})
.constant("production", {"EnvironmentConfig":{"api":"https://api.production.com/"}});
my config.json file with multiple environments: { "local": { "EnvironmentConfig": { "api": "http://localhost/" } }, "production": { "EnvironmentConfig": { "api": "https://api.production.com/" } } } Usage of the plugin: gulpNgConfig('myApp.config', { environment: 'production' }) Expected output: angular.module('myApp.config', []) .constant('EnvironmentConfig', {"api": "https://api.production.com/"});
But my output configFile.js: angular.module("todoApp.config", []) .constant("local", {"EnvironmentConfig":{"api":"http://localhost/"}}) .constant("production", {"EnvironmentConfig":{"api":"https://api.production.com/"}});
What's wrong? todo.zip