
Security News
Feross on TBPN: How North Korea Hijacked Axios
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.
angular-imagesloaded
Advanced tools
:camera: :white_check_mark: AngularJS integration for the imagesloaded library.
Comments and Pull Requests welcome!
npm install angular-imagesloaded --save
bower install angular-imagesloaded --save
<script src="path/to/lib/dist/angular-imagesloaded.min.js"></script>
Include bc.imagesloaded as a dependency in your project:
angular.module('YourModule', ['bc.imagesloaded']);
bc-imagesloadedUse this directive directly on an image as an attribute to create an imagesloaded instance for that specific image:
<img
src="http://lorempixel.com/400/300"
bc-imagesloaded
alt=""
/>
You can also pass in a selector string, NodeList or array to target multiple child elements:
<div bc-imagesloaded=".test">
<img
class="test"
src="http://lorempixel.com/400/300"
alt=""
/>
<img
class="test"
src="http://lorempixel.com/400/300"
alt=""
/>
</div>
bc-backgroundSet this attribute to true to enable imagesloaded on the background of the current element:
<div
bc-imagesloaded
bc-background="true"
style="background-image: url(http://lorempixel.com/400/300)"
></div>
You can also pass in a selector string to enable imagesloaded on multiple child elements:
<div
bc-imagesloaded
bc-background=".test"
>
<div
class="test"
style="background-image: url(http://lorempixel.com/400/300)"
></div>
<div
class="test"
style="background-image: url(http://lorempixel.com/400/300)"
></div>
</div>
When this attribute is set to true, imagesloaded will output debug logs to the console.
<img
src="http://lorempixel.com/400/300"
bc-imagesloaded
bc-debug="true"
alt=""
/>
Events can help ....
Triggered after all images have been either loaded or confirmed broken.
| Param | Type | Details |
|---|---|---|
instance | Object | The imagesLoaded instance |
<div
bc-imagesloaded=".image"
bc-always-method="vm.yourAlwaysMethod(instance)"
>
<img class="image" src="http://lorempixel.com/100/100" alt="" />
<img class="image" src="http://lorempixel.com/100/100" alt="" />
<img class="image" src="image/does/not/exist.jpg" alt="" />
</div>
class YourController {
constructor() {}
// This method will be called after all images are either loaded or confirmed broken
yourAlwaysMethod(instance) {
console.log('Images finished! Instance: ', instance)
}
}
Triggered after all images have successfully loaded without any broken images.
| Param | Type | Details |
|---|---|---|
instance | Object | The imagesLoaded instance |
<div
bc-imagesloaded=".image"
bc-always-method="vm.yourDoneMethod(instance)"
>
<img class="image" src="http://lorempixel.com/100/100" alt="" />
<img class="image" src="http://lorempixel.com/100/100" alt="" />
</div>
class YourController {
constructor() {}
// This method will be called after all images have loaded successfully
yourDoneMethod(instance) {
console.log('All images loaded successfully! Instance: ', instance)
}
}
Triggered after all images have been loaded with at least one broken image.
| Param | Type | Details |
|---|---|---|
instance | Object | The imagesLoaded instance |
<div
bc-imagesloaded=".image"
bc-always-method="vm.yourFailMethod(instance)"
>
<img class="image" src="http://lorempixel.com/100/100" alt="" />
<img class="image" src="http://lorempixel.com/100/100" alt="" />
<img class="image" src="image/does/not/exist.jpg" alt="" />
</div>
class YourController {
constructor() {}
// This method will be called after all images have loaded and at least one is broken
yourFailMethod(instance) {
console.log('All images loaded; at least one is broken! Instance: ', instance)
}
}
Triggered after each image has been loaded.
| Param | Type | Details |
|---|---|---|
instance | Object | The imagesLoaded instance |
image | Object | The LoadingImage instance of the loaded image |
<div
bc-imagesloaded=".image"
bc-always-method="vm.yourProgressMethod(instance, image)"
>
<img class="image" src="http://lorempixel.com/100/100" alt="" />
<img class="image" src="http://lorempixel.com/100/100" alt="" />
</div>
class YourController {
constructor() {}
// This method will be called after EACH image is loaded
yourProgressMethod(instance, image) {
console.log('An image was loaded! Instance: ', instance, ' Image: ', image)
}
}
npm run build - Build JSnpm run watch - Watch JS and rebuild on changenpm run test - Run testsnpm run watch:tests - Watch test files and re-run tests on changeJavaScript is all like "You images done yet or what?"
Created by David DeSandro.
FAQs
:camera: AngularJS integration for the imagesloaded library.
We found that angular-imagesloaded 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
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.

Security News
OpenSSF has issued a high-severity advisory warning open source developers of an active Slack-based campaign using impersonation to deliver malware.

Research
/Security News
Malicious packages published to npm, PyPI, Go Modules, crates.io, and Packagist impersonate developer tooling to fetch staged malware, steal credentials and wallets, and enable remote access.