constangular-brunch
Environment aware configurations for Angular with Brunch.
Last updated 6 years ago by tomtomgo .
Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install constangular-brunch 
SYNC missed versions from official npm registry.

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.

Current Tags

  • 0.1.4                                ...           latest (6 years ago)

5 Versions

  • 0.1.4                                ...           6 years ago
  • 0.1.3                                ...           6 years ago
  • 0.1.2                                ...           6 years ago
  • 0.1.1                                ...           6 years ago
  • 0.1.0                                ...           6 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 3
Last Day 0
Last Week 0
Last Month 2
Dependencies (2)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |