Created
July 15, 2014 08:39
-
-
Save AleksMeshkov/281da0f62a90c850acf0 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
$scope.specialist.photoUrl = false; | |
//Workaround for issue described here: https://issues.apache.org/jira/browse/CB-7131 | |
var imgLoadErr = function () { | |
$scope.specialist.photoUrl = false; | |
}; | |
var img = new Image(); | |
img.onerror = imgLoadErr; | |
img.onabort = imgLoadErr; | |
img.onload = function () { | |
$scope.specialist.photoUrl = img.src; | |
}; | |
img.src = contact.photos && contact.photos[0].value; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment