<commit_before># ng-fallback-src [![npm version](https://badge.fury.io/js/ng-fallback-src.svg)](https://badge.fury.io/js/ng-fallback-src)

> replace 404s with some default asset, for better [empty] states.

## Install

```bash
npm install --save ng-fallback-src

bower install --save ng-fallback-src
```

## Example Usage

This was originally meant for `img` tags only, but theoretically it could work for any element with a `src` tag. This theory is untested so _use at your own risk_.

```html
<img ng-src="{{someFlakyVar}} fallback-src={{someReliableUrl}} />"
```

Note: if `someFlakyVar` can be falsy, you'll need to account for it separately, e.g.

```html
<img ng-src="{{someFlakyVar || someReliableUrl}} 
  fallback-src={{someReliableUrl}} />"
```

since most browsers won't actually fire the error event if the `src` is empty.

## Contributing

The most obvious things right now are
- [ ] tests 
- [ ] adding files so this can be published to other package managers.


1. [**Fork**](https://github.com/JaKXz/ng-fallback-src/fork)

2. Create your feature branch: `git checkout -b my-new-feature`

3. Commit your changes: `git commit -am 'Add some feature'`

4. Push to the branch: `git push origin my-new-feature`

5. Create a new Pull Request

## Credits<commit_msg>Properly fix usage example syntax<commit_after># ng-fallback-src [![npm version](https://badge.fury.io/js/ng-fallback-src.svg)](https://badge.fury.io/js/ng-fallback-src)

> replace 404s with some default asset, for better [empty] states.

## Install

```bash
npm install --save ng-fallback-src

bower install --save ng-fallback-src
```

## Example Usage

This was originally meant for `img` tags only, but theoretically it could work for any element with a `src` tag. This theory is untested so _use at your own risk_.

```html
<img ng-src="{{someFlakyVar}}" fallback-src="{{someReliableUrl}}" />
```

Note: if `someFlakyVar` can be falsy, you'll need to account for it separately, e.g.

```html
<img ng-src="{{someFlakyVar || someReliableUrl}}" 
  fallback-src="{{someReliableUrl}}" />
```

since most browsers won't actually fire the error event if the `src` is empty.

## Contributing

The most obvious things right now are
- [ ] tests 
- [ ] adding files so this can be published to other package managers.


1. [**Fork**](https://github.com/JaKXz/ng-fallback-src/fork)

2. Create your feature branch: `git checkout -b my-new-feature`

3. Commit your changes: `git commit -am 'Add some feature'`

4. Push to the branch: `git push origin my-new-feature`

5. Create a new Pull Request

## Credits
{'fraction_non_alphanumeric': 0.1368584758942457, 'fraction_numerical': 0.006220839813374806, 'mean_word_length': 4.095049504950495, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6085808', 'n_tokens_mistral': 883, 'n_tokens_neox': 834, 'n_words': 303}