Skip to content

Instantly share code, notes, and snippets.

@AleksMeshkov
Created July 15, 2014 08:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AleksMeshkov/281da0f62a90c850acf0 to your computer and use it in GitHub Desktop.
Save AleksMeshkov/281da0f62a90c850acf0 to your computer and use it in GitHub Desktop.
$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