Created
September 12, 2017 22:04
-
-
Save danilat/055f28295d68367a5a45ecc7daeeb6a4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var AngularHttpClient = function($http){ | |
var httpClient = new HttpClient(); | |
httpClient.get = function (url) { | |
return new Promise(function (resolve, reject) { | |
$http.jsonp(url +'?callback=JSON_CALLBACK') | |
.success(function(data){ | |
resolve({body: data}); | |
}) | |
.error(function(data){ | |
reject({body: data}); | |
}); | |
}); | |
} | |
return httpClient; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment