Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/hyzhak/ng2-safe-img

very tiny and safe img for Angular 2
https://github.com/hyzhak/ng2-safe-img

Last synced: about 1 month ago
JSON representation

very tiny and safe img for Angular 2

Awesome Lists containing this project

README

        

# ng2-safe-img [![Build Status](https://travis-ci.org/hyzhak/ng2-safe-img.svg?branch=develop)](https://travis-ci.org/hyzhak/ng2-safe-img)
very tiny and safe img for Angular 2

Just consist from one structural directive - `*safeSrc`.
And should be used with with :

```html

```

# Example

Lets explain how does it work through example.

Here how should we use it

```html

```

if equal to 'https://placekitten.com/200/300'
we will get

```html

```

if is undefined or null
we will get

```html

```

so no any html elements will be there. What saves us from seeing something like this:

![unsafe img with undefined uri](unsafe-img-with-undefined-uri)