fix(Image): catch Response content may not be converted to an Image (#5856)

closes https://github.com/NativeScript/nativescript-angular/issues/851
closes https://github.com/NativeScript/NativeScript/issues/3381
This commit is contained in:
Nathan Walker
2018-06-13 03:45:54 -07:00
committed by Alexander Vakrilov
parent 0c3ecbc57b
commit 5cd8a1fc2a
2 changed files with 11 additions and 3 deletions

View File

@@ -33,7 +33,7 @@ export function getJSON<T>(arg: any): Promise<T> {
export function getImage(arg: any): Promise<ImageSource> {
return httpRequest
.request(typeof arg === "string" ? { url: arg, method: "GET" } : arg)
.then(responce => responce.content.toImage());
.then(response => response.content.toImage());
}
export function getFile(arg: any, destinationFilePath?: string): Promise<any> {