There's a better way. Anywhere Angular expects a function it will take an array as well. The array can be the usual list of dependencies and a function.<p>Here's a working version: <a href="http://jsbin.com/onevaz/1/" rel="nofollow">http://jsbin.com/onevaz/1/</a><p>For what it's worth, I agree that the docs need to reflect this.
Can someone explain why this is broken by minification? I'm not seeing it. Something about the parameter names ($scope, $attrs, $element) being re-written by the minifier? Does Angular require them to be named in a certain way?
Minification is overrated anyway.<p>1. After gzipping, which is done transparently by almost every server/client, the payload size savings from minification really aren't all that compelling.
2. Minification makes debugging your production code harder (digging through minified source) or more laborious (working with a source map).
3. Obfuscating your code runs antithetical to the open nature of the web