Security News
The Unpaid Backbone of Open Source: Solo Maintainers Face Increasing Security Demands
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
angular-image-404
Advanced tools
AngualrJS directive that shows a fallback image when img element can not show picture correct
AngualrJS directive that shows a fallback image when img element can not show picture correct.
You can install this directive with npm:
npm install --save angular-image-404
Install with Bower:
bower install --save --allow-root angular-image-404
or just download it.
After install, you need to include the dist/angular-image-404.js
in html like this:
<script type="text/javascript" src="./angular-image-404/dist/angular-image-404.js"></script>
And add directive module in dependience list:
var app = angular.module('app', ['angular-image-404']);
Now you can use it in html like this:
<img src="./notFound.jpg" image-404="./fallback.jpg" width=200 height=120>
And you can set the attribute image-404
as empty:
<img src="./notFound.jpg" image-404 width=200 height=120>
if image-404
set as empty, directive will get placeholder image from http://dummyimage.com, and you can set the fallback image with the following attribute:
fb-bgcolor
: background colorfb-color
: color of the text on the imagefb-text
: text on the imagelike this:
<img src="./notFound.jpg" image-404 fb-bgcolor="#C0392B" fb-color="#C5EFF7" fb-text="Not Found" width=200 height=120>
If you want to run example, you should run npm i:
npm i
and run gulp with test
task:
gulp test
BTW, gulp release
will create release js file in ./dist
folder.
FAQs
AngualrJS directive that shows a fallback image when img element can not show picture correct
The npm package angular-image-404 receives a total of 4 weekly downloads. As such, angular-image-404 popularity was classified as not popular.
We found that angular-image-404 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.
Security News
A developer is accusing Tencent of violating the GPL by modifying a Python utility and changing its license to BSD, highlighting the importance of copyleft compliance.