ngbrowserify

0.1.7 • Public • Published

ngbrowserify

Angular function injection to array injection transform for browserify.

browserify -t ngbrowserify main.js -o main.bundle.js

Or use it from the command-line instead of ngmin:

ngbmin < input.js > output.js

example input

angular.module('m').factory('f', 
    function($rootScope, $http) {
        // code    
    });

Output:

angular.module('m').factory('f', 
    ['$rootScope', '$http', function($rootScope, $http) {
        // code    
    }]);

alternate syntax

Named function expressions that end with '$ng' will always be transformed.

var factory = function myModule$ng($scope, $http) {
};
angular.module('m').factory('f', factory);

Output:

var factory = [$scope, $http, function myModule$ng($scope, $http) {
}];
angular.module('m').factory('f', factory);

license

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i ngbrowserify

Weekly Downloads

5

Version

0.1.7

License

MIT

Last publish

Collaborators

  • spion