Closed danwkennedy closed 9 years ago
Ty for fixing this oversight!
I'm not sure that working:
{
"dev": {
"EnvironmentConfig": {
"api": "http://localhost/"
}
},
"production": {
"EnvironmentConfig": {
"api": "https://api.production.com/"
}
}
}
gulp.task('ngConfig', function () {
return gulp.src(config.configJson)
.pipe(gulpNgConfig('dcc.config'), {
environment: 'production'
})
.pipe(gulp.dest(config.scripts))
});
angular.module('dcc.config', [])
.constant('production', {"EnvironmentConfig":{"api":"https://api.production.com/"}});
angular.module('dcc.config', [])
.constant('dev', {"EnvironmentConfig":{"api":"http://localhost/"}})
.constant('production', {"EnvironmentConfig":{"api":"https://api.production.com/"}});
Maybe I did not understand how to use it?
Thank you, bye
It looks like your gulpfile has an incorrect syntax:
.pipe(gulpNgConfig('dcc.config'), {
environment: 'production'
})
You're passing the configuration as a second argument to pipe
, rather than gulpNgConfig
You'll want to tweak it so it's passed to gulpNgConfig
:
.pipe(gulpNgConfig('dcc.config', {
environment: 'production'
}))
More details here
You are right, it is my mistake. It run, grazie.
:smile: :+1:
...nts from getting written to the output file.