Last active
June 20, 2016 11:47
-
-
Save satishSKY/d55f2e669dfb1612c04731bf37a3fbfc to your computer and use it in GitHub Desktop.
image 404 status checking
This file contains hidden or 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
| .directive('errSrc', function () { // image 404 status checking | |
| return { | |
| link: function (scope, element, attrs) { | |
| element.bind('error', function () { | |
| if (attrs.src != attrs.errSrc) { | |
| attrs.$set('src', attrs.errSrc); | |
| } | |
| }); | |
| } | |
| }; | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment