AngularJS directive for detecting SVG support and providing a PNG fallback for unsupported browsers.
0 people use it
Author: 1856992? tinacious

SVG to PNG fallback in AngularJS

This Angular directive will automatically replace the file extension *.svg with *.png for browsers that do not support SVG.

Modernizr is a dependency for SVG support detection.


You can install angular-svg-png and its dependency (Modernizr) as well as inject it in your project using the following command:

After install, add svgPng to your app's dependencies.

The screenshot below shows an SVG image being swapped out for a PNG.

comments powered by Disqus
This page was last updated about 4 years ago.