# use-img-fallback

> A simple directive for setting a global fallback image that loads in the event img tags encounter an error

Latest version **0.0.5** (published 2018-03-20) · ISC license · 0 weekly downloads

## Install

```sh
npm install use-img-fallback
pnpm add use-img-fallback
yarn add use-img-fallback
bun add use-img-fallback
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.5 |
| Published | 2018-03-20 |
| First published | 2018-03-16 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 268.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | PoCT |
| Maintainers | stephen-poct |
| Keywords | angular, angular4, aot, aot-compatible, aot-compilation, library, ng, typescript, image, plaeholder, fallback |

## Links

- npm: https://www.npmjs.com/package/use-img-fallback
- npm.io page: https://npm.io/package/use-img-fallback

## Alternatives

- [angular-pipes](https://npm.io/package/angular-pipes.md) — 5.6K weekly downloads
- [@ng-web-apis/midi](https://npm.io/package/@ng-web-apis/midi.md) — 2.6K weekly downloads
- [happn-3](https://npm.io/package/happn-3.md) — 1.6K weekly downloads
- [@opensip-cli/lang-go](https://npm.io/package/@opensip-cli/lang-go.md) — 1.2K weekly downloads
- [mongoose-typescript](https://npm.io/package/mongoose-typescript.md) — 85 weekly downloads

## Recent versions

- 0.0.5 (latest) — 2018-03-20
- 0.0.4 — 2018-03-16
- 0.0.3 — 2018-03-16
- 0.0.2 — 2018-03-16
- 0.0.1 — 2018-03-16

## README

# use-img-fallback

A simple directive for loading a fallback image incase other images fail

## Configure Global Image for fallback
```ts
constructor(useImgFallbackConfig: UseImgFallbackConfig){
    useImgFallbackConfig.setDefaultImageUrl('[img-source]');
}
```

## Use global image for fallback on an image tag
```html
<img src="[some-source]" use-img-fallback/>
```

## Use a specific image for a specific img tag
```html
<img src="[some-source]" use-img-fallback="[specific-fallback-image]"/>
```

---
_Source: https://npm.io/package/use-img-fallback · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
