Many people think that it is some kind of magic, how AngularJS resolves dependencies given as function arguments. But it isn't any magic. I'll show you, how they achieve it. This technique can be used everywhere, not just with AngularJS.
If you don't know what does dependency injection look like with AngularJS, here is an example...
It's fairly easy in JavaScript to get the source code of the every function. We just have to call the.toString() method of the function objects. Here we go. We just have to find a way to extract the argument list of our function...
Your new post is loading...