ng-config

1.0.0 • Public • Published

ng-config

Build Status

Generate Angular constants from POJO

Usage

ng-config returns a single function that takes an optional options object and returns a string.

Example:

var fs = require('fs');
var ngConfig = require('ng-config');
var options = {
  constants: {
    hello: 'world'
  }
};
 
var config = ngConfig(options);
 
console.log(config);
// =>
// 'use strict';
// angular.module('config', [])
//   .constant('hello', 'world');
 
fs.writeFileSync('app/config.js', config);

The module name and template are customisable. See the source the current defaults.

See also

Author

© 2014 Tom Vincent git@tlvince.com

License

Licensed under the MIT license.

/ng-config/

    Package Sidebar

    Install

    npm i ng-config

    Weekly Downloads

    2

    Version

    1.0.0

    License

    MIT

    Last publish

    Collaborators

    • tlvince