Nicely said Mauro... with one (1) slight change. I think you meant to say 
"minification"...
That is what the `uglify` process does: it minifies and obfuscates. 

So the annotation solution [in AngularJS] preserves the original names of 
the arguments so DI continues to work after the code has been uglified.



On Wednesday, January 22, 2014 1:47:31 AM UTC-6, Mauro Servienti wrote:
>
>   .config(['$httpProvider', function($httpProvider) {
>
>  
>  At config time you cannot depend on anything other than providers.
> In general the syntax [’name’, function] is to express dependency that 
> survives to magnification.
> The AngularJS Dependency Engine, due to the way JavaScript does not work, 
> in the sense that is misses types, can only resolve dependencies by name, 
> thus it inspects the name of the arguments of your function and grab 
> dependencies.
> If a magnification process changes the naming AngularJS cannot resolve 
> dependencies anymore, the annotation syntax is there to let your code 
> “survive” to minification.
>
>  .m
>  

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to