Dependency injection was one of AngularJS's first evil magicks I encountered. The idea that calling this function will magically reach out to the universe and grab the correct values for$scope and $http runs contrary to all the JavaScript I've ever used. You can't do that!
So I dug in to discover the magicks. And now it's not magic! It's great! It's rougly equivalent to import in Python or require in Ruby. Here's how it works:
Your new post is loading...