atticoos / gulp-ng-config

:wrench: Create AngularJS constants from a JSON config file
MIT License
173 stars 35 forks source link

Filter config.json with environment value. #13

Closed laranicolas closed 9 years ago

laranicolas commented 9 years ago

"development": { "string": "my string", "integer": 12345, "object": {"one": 2, "three": ["four"]}, "array": ["one", 2, {"three": "four"}, [5, "six"]] }, "staging": { "string": "my string", "integer": 12345, "object": {"one": 2, "three": ["four"]}, "array": ["one", 2, {"three": "four"}, [5, "six"]] }, "production": { "string": "my string", "integer": 12345, "object": {"one": 2, "three": ["four"]}, "array": ["one", 2, {"three": "four"}, [5, "six"]] }

atticoos commented 9 years ago

Are you suggesting being able to pass in a parameter that tells the gulp plugin which one of those objects to use? If so, :+1:

laranicolas commented 9 years ago

@ajwhite Yes of course!! I think that is easiest!

eddie commented 9 years ago

:+1: however, I think it would be better to switch between config files, not to store all config in one file. Perhaps this is best left to gulp and not to ng-config?

atticoos commented 9 years ago

@eddie I think multiple configs would mean deciding your source for the gulp stream, yes.

However, @laranicolas's suggestion I think is also a good one -- I could see it going either way here, in which we'd handle that in gulp-ng-config obviously.

I think both are valid, and would like to have the flexibility of both

atticoos commented 9 years ago

Added in https://github.com/ajwhite/gulp-ng-config/pull/18 and will be in the v1.1.0 release.

Thanks for your suggestion @laranicolas

laranicolas commented 9 years ago

Cool!!! The next release suggested I will try to do it!