javascript - Images not loading in angular page in IE -


right have angular page makes request server data. in data urls images in s3. once data has been retrieved, variable on scope set data. in view iterate through these items , make block of html each one.

the issue arises in ie (and people on team, not of them) instead of images loading failed load image icon shows up. again not happen everyone, not happen if ie console open, not happen in other browser have tried. if reload page show normal.

here controller (i have stripped out unnecessary stuff):

$http.get('/url').success(function (data, status, headers, config) {     $scope.cardlist = data; }) 

here relevant piece of view:

<div class="card-tile white_box" ng-repeat="card in cardlist.cards">         <div class="card-tile-header pointer">             <span class="card-month">{{card.monthname}} {{card.year}}</span>         </div>         <div class="card-tile-content pointer" >             <img ng-src="{{ card && card.imageurl || ''}}" />         </div>     </div> 

you must have using ie9, , regarding console.log. somewhere in code using console.log failing in ie while console not open.

the reason ie9 doesn't create window.console unless open console using f12.

for avoiding such error define console object in global javascript file should loaded before other custom js files

if (!window.console) {     window.console = {}; }  if (!console.log) {     console.log = function() {}; } 

reference answer more details


Comments