s-yadav / angulargrid

Pinterest like responsive masonry grid system for angular
MIT License
277 stars 105 forks source link

Show custom error image #139

Open ElFlamingoDiablo opened 6 years ago

ElFlamingoDiablo commented 6 years ago

Hello,

first of all nice work and thanks for the effort.

I wanted to ask you if and how it is possible to show a custom error image if an image is not available at the defined source. Currently only a browen image symbol gets shown, but I want to show a placeholder image if the image could not be loaded.

This is what I do in html but the placeholder image will not get set on error like in a normal list or table.

<div class="dynamic-grid angular-grid" angular-grid="vm.items" ag-gutter-size="10" ag-options="{cssGrid : true, refreshOnImgLoad: true}"ag-id="opinionsGrid" style=">
    <div class="grid col-md-6" ng-repeat="user in users">
        <img alt="image" ng-src="https://some.url/{{user | escape}}" onError="this.onerror=null;this.src='img/placeholder.png';">
     </div>
</div>

Can someone help?