import-angular-value
Imports value object from Angular module.value
Getting Started
This plugin requires Grunt ~0.4.5
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install import-angular-value --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt;
The "import_angular_value" task
Overview
In your project's Gruntfile, add a section named import_angular_value
to the data object passed into grunt.initConfig()
.
grunt;
Options
options.path
Type: String
Default value: null
Path to JS file containing module.value call
options.modules
Type: Array
Default value: []
array of module names used in js
options.configVarName
Type: String
Default value: 'angularValue'
name of grunt config key where loaded configuration will be stored
Usage Examples
Default Options
In this example, the default options are used to do something with whatever.
grunt;
../js/config.js content:
MyModule1value'config' host: 'example.com'; MyModule2value'config2' port: 8080;
and you can use these values in gruntfile, like:
some_other_task: options: hostname: <%=angularValueMyModule1confighost> port: <%=angularValueMyModule2config2port>
Contributing
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.
Release History
(Nothing yet)