![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
angular-images-loaded-jtt
Advanced tools
####Image load detector with progress events
#####REQUIREMENTS
#####INSTALLATION
jtt_imagesLoaded
in your main app module.#####USAGE
Put directive data-images-loaded on an element containing images.
Eg.
<div data-images-loaded>
<div data-ng-repeat="image in images">
<img ng-src="http://lorempixel.com/{{image.src}}">
<div>Foo Bar</div>
</div>
</div>
You can nest the directive
Eg.
<div data-images-loaded>
..................
<div data-images-loaded>
<div data-ng-repeat="image in images1">
<img ng-src="http://lorempixel.com/{{image.src}}">
<div>Foo Bar</div>
</div>
</div>
<div data-images-loaded>
<div data-ng-repeat="image in images2">
<img ng-src="http://lorempixel.com/{{image.src}}">
<div>Foo Bar</div>
</div>
</div>
</div>
That's it!
#####EVENTS(Always available)
imagesLoaded.SUCCESS - All images have been successfully loaded
imagesLoaded.FAIL - All images have been loaded with atleast 1 failed image
imagesLoaded.ALWAYS - All images are done, whether successfully loaded or failed to load. This event is always broadcasted
Subscribe to these events in your controller as shown below
$scope.$on('imagesLoaded.SUCCESS', function() {
console.log('ALL LOADED');
});
$scope.$on('imagesLoaded.FAIL', function() {
console.log('ALL LOADED WITH ATLEAST ONE FAILED');
});
$scope.$on('imagesLoaded.ALWAYS', function() {
console.log('ALL DONE ALWAYS');
});
#####PROGRESS EVENTS
imagesLoaded.QUARTER - One fourth of total images have been loaded/failed
imagesLoaded.HALF - Half of total images have been loaded/failed
imagesLoaded.THREEQUARTERS - Three fourth of total images have been loaded/failed
imagesLoaded.FULL - All images have been loaded/failed
Main event is imagesLoaded.PROGRESS, other events are received in the callback via progress.status
Subscribe to these progress events in your controller as shown below
$scope.$on('imagesLoaded.PROGRESS', function($event, progress) {
console.log(progress);
switch(progress.status) {
case 'imagesLoaded.QUARTER':
$scope.progress = 25;
break;
case 'imagesLoaded.HALF':
$scope.progress = 50;
break;
case 'imagesLoaded.THREEQUARTERS':
$scope.progress = 75;
break;
case 'imagesLoaded.FULL':
$scope.progress = 100;
break;
}
});
#####Note :-
<div data-images-loaded data-use-progress-events="yes">
<div data-ng-repeat="image in images">
<img ng-src="http://lorempixel.com/{{image.src}}"/>
<div>Foo Bar</div>
</div>
</div>
data-use-progress-events="yes" to listen to progress events
data-use-progress-events="no" to skip progress events and just listen to main events
This approach is taken to minimise $digest cycles in case you wish to skip progress events, since all angular-specific changes take place in the $digest cycle. That's why, I have kept progress events to a minimum, otherwise N images load will cause N $digest cycles to notify the subscriber, which can hamper performance.
$scope.$on('imagesLoaded.PROGRESS', function($event, progress) {
console.log(progress);
$event.stopPropagation();
switch(progress.status) {
case 'imagesLoaded.QUARTER':
$scope.progress = 25;
break;
case 'imagesLoaded.HALF':
$scope.progress = 50;
break;
case 'imagesLoaded.THREEQUARTERS':
$scope.progress = 75;
break;
case 'imagesLoaded.FULL':
$scope.progress = 100;
break;
}
});
FAQs
Image load detector
We found that angular-images-loaded-jtt 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
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.