In AngularJS, how can I load a different image, if the one specified at first could not be found? In the case at hand, I have a slug, and don't know what the file extension will be. It could e.g. be png, jpg, svg.

What I want to do is:

```
<img ng-src="images/{{slug}}" />

```

And then I want it to go and check

```
images/{{slug}}.png
images/{{slug}}.jpg
images/{{slug}}.svg

```

until it has found a file that exists.

Is there a function that fires if an image could not be loaded?