Skip to content

dfenstermaker/nginjector-loader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ngInjector-loader

Webpack loader to resolve angular-injector functions

Simple wrapper around angular-injector to allow it to be used as a loader. Can be used as a config loader like so:

  module: {
    "loaders": [
      { "test": /\.js$/, "exclude": [/node_modules/], "loader": "ngInjector-loader" }
    ]
  }

Or it can be used as a require loader (but not the recommended use case) like so:

  require("ngInjector!./name/of/file.js")

The output of the above is to take functions wrapped in ng and output a function wrapped in an array with it's parameters properly injected.

input:

  ng( function ($scope, $attrs) {} )

output:

  ["$scope", "$attrs", function ($scope, $attrs) {}]

angular-inject docs:

https://www.npmjs.com/package/angular-injector

About

Webpack loader to resolve angular-injector functions

Resources

Stars

Watchers

Forks

Packages

No packages published