html
<img error-src="../img/xxx.png" ng-src="{{imgPath}}"/>
directive
xxx.directive('errorSrc', function () { var errorSrc = { link: function postLink(scope, element, attrs) {element.bind('error', function() {angular.element(this).attr("src", attrs.errorSrc); }); } } return errorSrc;})