From http://stackoverflow.com/questions/12131659/from-jquery-ajax-to-angular-http