Skip to content

Commit

Permalink
Merge pull request #502 from eddiemonge/498
Browse files Browse the repository at this point in the history
docs(readme): add note about ngmin limitations
  • Loading branch information
sindresorhus committed Dec 13, 2013
2 parents aef2c61 + 1203a73 commit fa5ce84
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,24 @@ angular.module('myMod').controller('MyCtrl',

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

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.
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.:
```javascript
resolve: {
User: function(myService) {
return MyService();
}
}
```

will need to be manually done like so:
```javascript
resolve: {
User: ['myService', function(myService) {
return MyService();
}]
}
```


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

0 comments on commit fa5ce84

Please sign in to comment.