I have some angular factories for making ajax calls towards legacy ASP.NET .asmx web services like so:
module.factory(\'productService\', [\"$http\",
function ($
In response to the testing aspect of your question, Fiddler has a really useful function that helps when you need to simulate delays:
The AutoResponder functionality in Fiddler is extremely useful for testing JS that involves a lot of http requests. You can set it to respond with particular http error codes, block responses, etc.