remove-dollar-inject
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)
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)
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