remove-dollar-inject

3.1.1 • Public • Published

remove-dollar-inject

Travis npm Code Climate Code Climate Greenkeeper badge semantic-release

A library for removing $inject from Angular source files.

Install

yarn install -D remove-dollar-inject

or

npm install --save-dev remove-dollar-inject

Usage

ES6

import removeDollarInject from 'remove-dollar-inject';

const input = "ExampleService.$inject = ['$q']; angular.module('app.example').service('ExampleService', ExampleService);";
const output = removeDollarInject(input);
console.log(output)
/*
 * angular.module('app.example').service('ExampleService', ExampleService);
 */

ES5

const removeDollarInject = require('remove-dollar-inject');

const input = "ExampleService.$inject = ['$q']; angular.module('app.example').service('ExampleService', ExampleService);";
const output = removeDollarInject(input);
console.log(output)
/*
 * angular.module('app.example').service('ExampleService', ExampleService);
 */

API

Table of Contents

removeDollarInject

Removes any $inject assignment expressions from a given source string.

Will return an empty string for any null/undefined/void values.

Parameters

  • source string String from which to remove any $inject (optional, default '')

Returns string Source string without $inject assignment expressions

License

MIT (C) Richard Harrah

Readme

Keywords

none

Package Sidebar

Install

npm i remove-dollar-inject

Weekly Downloads

1

Version

3.1.1

License

MIT

Unpacked Size

7.44 kB

Total Files

5

Last publish

Collaborators

  • topplethenun