Merge pull request #4078 from NativeScript/fix-image-src-binding

Binding Image's src to 'res://icon' fails as bindings wrap string in String
This commit is contained in:
Alexander Vakrilov
2017-04-28 15:45:33 +03:00
committed by GitHub

View File

@ -28,7 +28,7 @@ export abstract class ImageBase extends View implements ImageDefinition {
let value = this.src; let value = this.src;
let originalValue = value; let originalValue = value;
let sync = this.loadMode === "sync"; let sync = this.loadMode === "sync";
if (typeof value === "string") { if (typeof value === "string" || value instanceof String) {
value = value.trim(); value = value.trim();
this.imageSource = null; this.imageSource = null;
this["_url"] = value; this["_url"] = value;