close

  menu      DavidRodenas
CONTACT  

ngAnnotate browserify transform

It automatically adds AngularJS injection annotations. It use @ngInject comments or AngularJS definitions.


$ npm i -D browserify-ngannotate
transforms.push('browserify-ngannotate')
/* @ngInject */ function(myService) { ... }

Overview

It transforms:

/* @ngInject */ function myFactory(myService) { ... }

into:

/* @ngInject */ function myFactory(myService) { ... }
myFactory.$inject = ['myService'];

So it can be minimized safely.

## Recommendations

It is recommended to use ng-strict-di: