Closed felixhorro closed 6 years ago
Support added to existing options.environment
in #61
This is now published under the v1.4.0
release
Thanks, but #61 doesn't fit my needs.
As an example, I want to expose app version as an angular constant, so I use gulp-ng-config to get it from the package.json of my project. I only need "version" property, don't want to make "name", "description", "dependencies", etc. constants.
Thanks!
I see, so you want the specified key to actually be added to the constant, not just the children.
For example:
{
"wanted": "foobar",
"environmentA": {
"hello": "world"
}
}
Using environment
gulpNgConfig('appConfig', {
environment: 'environmentA'
})
Will produce
angular.module('appConfig', [])
.constant('hello', 'world')
What you want is to actually specify that key and have it become part of the output:
gulpNgConfig('appConfig', {
keys: 'environmentA'
})
Producing
angular.module('appConfig', [])
.constant('environmentA', {'hello': 'world'})
Is this accurate?
@felixhorro let me know on the above, we can still look at this. And since we have a bunch of conflicts, let me know if you still want to address this, or otherwise I'm happy to.
@ajwhite You're right, I need the key to be imported, not the children.
Conflicts solved!
:tada: :tada: :confetti_ball: :confetti_ball: :tada: :tada: Thanks!
If you only want some of the keys from the object imported, you can supply the keys you want the plugin to load.