Closed adharris closed 10 years ago
HI @adharris, thanks for catching that.
angular-json-human
uses ngmin
to add DI annotation. RecursionHelper
should've been added by ngmin
but it wasn't. So I investigated this further to find out why it didn't work. I believe the reason ngmin
didn't work is because I manually injected $compile
above so ngmin
probably thought it doesn't need to add DI annotation to this file.
I'd like to resolve this by removing manual DI injection ($compile
) so that ngmin
works correctly again. Would you like to change the code to do that?
Oh, huh, didn't notice the ngmin. I'm actually concating and minifying separately in my build scripts. That might explain why I'm getting this issue.
Once the correct fix is merged, even if you are concatenating and minifying separately, if you are using dist/angular-json-human.js
, you will have properly DI annotated code.
Would you like to fix it the way I suggested above? If you'd rather have me do it, let me know. Otherwise, I'll wait for your new commit before merging this PR.
Yup, you're right. Removing the $compile
on the RecursionHelper
made both the minified and unminified files have the proper annotations. Here's a new commit.
Thanks for the contribution @adharris.
The jsonHumanHelper directive uses angular's ability to infer dependencies, which only works when the code is not minified. This simply adds an annotation to the directive definition.