cb

constangular-brunch

Environment aware YAML configurations for Angular with Brunch

Showing:

Popularity

Downloads/wk

18

GitHub Stars

7

Maintenance

Last Commit

7mos ago

Contributors

5

Package

Dependencies

2

Size (min+gzip)

13.3KB

License

Type Definitions

Tree-Shakeable

No?

Categories

Readme

constangular-brunch

It does:

  • Reads YAML configuration files, parses them and adds them to your Angular app as a module.

  • Constangular is environment-dependent so it allows you to have multiple configs for multiple environments.

Example

app/config/api.yaml:

development:
  base_url: http://localhost:3000/
  api_key: kthxbye

production:
  base_url: http://api.suchurl.co/
  api_key: g5e4rrdy66f6da6fduka

app/app.coffee:

App = angular.module 'MyApp', ['config.api']

App.constants = {}

App.config ['apiConfig', (apiConfig) ->
  App.constants.api = apiConfig
]

You see the pattern there:

  • Constangular finds files in app/config/some_name.yaml
  • Exports their contents as constants named some_nameConfig to an angular module named config.some_name

Usage

Add 'constangular-brunch': '*' to your package.json.

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100