JSPM

use-img-fallback

0.0.5
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 3
    • Score
      100M100P100Q35300F
    • License ISC

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

    Package Exports

    • use-img-fallback

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (use-img-fallback) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    use-img-fallback

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

    Configure Global Image for fallback

    constructor(useImgFallbackConfig: UseImgFallbackConfig){
        useImgFallbackConfig.setDefaultImageUrl('[img-source]');
    }

    Use global image for fallback on an image tag

    <img src="[some-source]" use-img-fallback/>

    Use a specific image for a specific img tag

    <img src="[some-source]" use-img-fallback="[specific-fallback-image]"/>