Skip to content

Commit 1203a73

Browse files
committed
docs(readme): add note about ngmin limitations
Add note about what ngmin does not minsafe Fixes #498
1 parent ba7b505 commit 1203a73

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

Diff for: readme.md

+18-1
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,24 @@ angular.module('myMod').controller('MyCtrl',
233233

234234
The annotations are important because minified code will rename variables, making it impossible for AngularJS to infer module names based solely on function parameters.
235235

236-
The recommended build process uses `ngmin`, a tool that automatically adds these annotations. However, if you'd rather not use `ngmin`, you have to add these annotations manually yourself.
236+
The recommended build process uses `ngmin`, a tool that automatically adds these annotations. However, if you'd rather not use `ngmin`, you have to add these annotations manually yourself. **One thing to note is that `ngmin` does not produce minsafe code for things that are not main level elements like controller, services, providers, etc.:
237+
```javascript
238+
resolve: {
239+
User: function(myService) {
240+
return MyService();
241+
}
242+
}
243+
```
244+
245+
will need to be manually done like so:
246+
```javascript
247+
resolve: {
248+
User: ['myService', function(myService) {
249+
return MyService();
250+
}]
251+
}
252+
```
253+
237254

238255
### Add to Index
239256
By default, new scripts are added to the index.html file. However, this may not always be suitable. Some use cases:

0 commit comments

Comments
 (0)