Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use explicit dependency injection syntax #61

Closed
wants to merge 1 commit into from

Conversation

anstosa
Copy link

@anstosa anstosa commented Jul 30, 2014

In both cases where the hotkeys service is injected, use the explicit
dependency declaration syntax instead of relying on the parameter names.

This makes the library compatible with variable manglers.

Large projects often concat all their JS into a single file and uglify it. If they mangle variables, angular-hotkeys will break because Angular tries to infer the dependency names from parameters.

Relevant Angular docs: Inline Array Annotation

In both cases where the `hotkeys` service is injected, use the explicit
dependency declaration syntax instead of relying on the parameter names.

This makes the library compatible with variable manglers.
@chieffancypants
Copy link
Owner

This is done automatically in the build process using ng-min. Did you encounter an issue where it wasn't working properly? Please re-open if so. Thanks!

@anstosa
Copy link
Author

anstosa commented Jul 30, 2014

Ah I see. No, we use unminified libraries in our project because if you minify everything at once the compression is (marginally) better. No worries!

@chieffancypants
Copy link
Owner

Ah! so this would work for you if the build directory used the ng-min version for the unminified file then, right?

@anstosa
Copy link
Author

anstosa commented Jul 30, 2014

Yes I believe it would

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants