Showing posts with label ng2-safe-img. Show all posts
Showing posts with label ng2-safe-img. Show all posts
ng2-safe-img

ng2-safe-img

December 20, 2017
very tiny and safe img for Angular 2 Just consist from one structural directive - *safeSrc. And should be used with with :
 

Example

Lets explain how does it work through example.
Here how should we use it
 
if equal to 'https://placekitten.com/200/300' we will get
 
if is undefined or null we will get
 
so no any html elements will be there. What saves us from seeing something like this: unsafe img with undefined uri
Note: Special thanks to Eugene Krevenets
Contact: ievgenii.krevenets@gmail.com
Disclaimer: The blog is created to share angular directives information to geek, curious Angular Developers.