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

Minification #19

Open
jpolack opened this issue Mar 20, 2016 · 0 comments
Open

Minification #19

jpolack opened this issue Mar 20, 2016 · 0 comments

Comments

@jpolack
Copy link

jpolack commented Mar 20, 2016

Hey guys,

i just noticed that there might be an issue with minifing your code.
The problem is that the parameters passed to the functions must be named as the service, because if the file gets minified the parameters get shortnames.

So something like this:

var container = require('simple-ioc').getContainer();
container.autoRegisterPath( './services' );
container.inject(function(myService){
    myService.print("Hello World");
});

would turn to this:

container.inject(function(a){
    a.print("Hello World");
});

AngluarJS has a solution where you name the services first you want to inject. Just like this:

TestApp.controller("TestController", ["myService", function (myService) {
    myService.print("Hello World");
}]);

would turn to this:

TestApp.controller("TestController", ["myService", function (a) {
    a.print("Hello World");
}]);

Would be nice to have something similar since minification is used in many projects.

Thanks

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

No branches or pull requests

1 participant