2

So I am using a custom directive that loads a secondary image source if the first image source resolves to a 404 using this directive.

  .directive('errSrc', function() {
    return {
      link: function(scope, element, attrs) {
        element.bind('error', function() {
          if (attrs.src != attrs.errSrc) {
            attrs.$set('src', attrs.errSrc);
          }
        });
      }
    }

This works great, and if a ng-src="" resolves to 404 then it loads the err-src="" that is on that image and replaces it. However is there a way to suppress the 404 message generated in console? The function works fine but it is really hard to debug when you see 404 image missing 100 times in a row.

CMOS
  • 2,727
  • 8
  • 47
  • 83

1 Answers1

2

Pankaj Pakar pretty much answered it, after much googling it seems that this is not possible currently. Closing.

CMOS
  • 2,727
  • 8
  • 47
  • 83