Generate Angular constants from POJO
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 for the current defaults.
- Need streams? gulp-ng-constant
- Need Grunt support? grunt-ng-constant
© 2014 Tom Vincent [email protected]
Licensed under the MIT license.