Socket
Book a DemoInstallSign in
Socket

import-angular-value

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

import-angular-value

Imports value object from Angular module.value

0.1.5
latest
Source
npmnpm
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

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.loadNpmTasks('import-angular-value');

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.initConfig({
  import_angular_value: {
            path: null,
            modules: [],
            configVarName: 'angularValue'
  },
});

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.initConfig({
  import_angular_value: {
    options: {
        path: '../js/config.js',
        modules: ['MyModule1', 'MyModule2']
    }
  },
});

../js/config.js content:

MyModule1.value('config', { host: 'example.com'});

MyModule2.value('config2', { port: 8080});

and you can use these values in gruntfile, like:


some_other_task: {
    options: {
        hostname: <%=angularValue.MyModule1.config.host>,
        port: <%=angularValue.MyModule2.config2.port>,
    }
}

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)

Keywords

angular value grunt

FAQs

Package last updated on 19 Aug 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.