Gathering detailed insights and metrics for @jitenderbadoni/ngx-image-video-gallary
Gathering detailed insights and metrics for @jitenderbadoni/ngx-image-video-gallary
Gathering detailed insights and metrics for @jitenderbadoni/ngx-image-video-gallary
Gathering detailed insights and metrics for @jitenderbadoni/ngx-image-video-gallary
Probably the best Angular 4+ modal and inline image gallery. Angular upgrade for ng-image-gallery.
npm install @jitenderbadoni/ngx-image-video-gallary
Typescript
Module System
Min. Node Version
Node Version
NPM Version
JavaScript (34.07%)
TypeScript (33.2%)
CSS (20.71%)
HTML (12.03%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
82 Commits
1 Watchers
2 Branches
1 Contributors
Updated on Jun 10, 2020
Latest Version
1.0.1
Package Id
@jitenderbadoni/ngx-image-video-gallary@1.0.1
Unpacked Size
188.93 kB
Size
47.21 kB
File Count
46
NPM Version
6.4.1
Node Version
10.15.1
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
38
Probably the best Angular 4+ modal and inline image gallery. Angular upgrade for ng-image-gallery.
npm i -s hammerjs
Then import hammerjs into your project (tip: in you main.ts file), e.g:
import 'hammerjs';
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
document.addEventListener('DOMContentLoaded', () => {
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.log(err));
});
1npm install --save ngx-image-gallery
1import { NgxImageGalleryModule } from 'ngx-image-gallery'; 2 3@NgModule({ 4 ..., 5 imports: [ 6 NgxImageGalleryModule, 7 ... 8 ] 9}) 10export class AppModule { }
1// app.component.html 2 3<ngx-image-gallery 4[images]="images" 5[conf]="conf" 6(onOpen)="galleryOpened($event)" 7(onClose)="galleryClosed()" 8(onImageClicked)="galleryImageClicked($event)" 9(onImageChange)="galleryImageChanged($event)" 10(onDelete)="deleteImage($event)" 11></ngx-image-gallery>
1import { Component, OnInit, ViewChild } from '@angular/core'; 2import { NgxImageGalleryComponent, GALLERY_IMAGE, GALLERY_CONF } from "ngx-image-gallery"; 3 4@Component({ 5 selector: 'app-root', 6 templateUrl: './app.component.html', 7 styleUrls: ['./app.component.scss'] 8}) 9export class AppComponent implements OnInit { 10 // get reference to gallery component 11 @ViewChild(NgxImageGalleryComponent) ngxImageGallery: NgxImageGalleryComponent; 12 13 // gallery configuration 14 conf: GALLERY_CONF = { 15 imageOffset: '0px', 16 showDeleteControl: false, 17 showImageTitle: false, 18 }; 19 20 // gallery images 21 images: GALLERY_IMAGE[] = [ 22 { 23 url: "https://images.pexels.com/photos/669013/pexels-photo-669013.jpeg?w=1260", 24 altText: 'woman-in-black-blazer-holding-blue-cup', 25 title: 'woman-in-black-blazer-holding-blue-cup', 26 thumbnailUrl: "https://images.pexels.com/photos/669013/pexels-photo-669013.jpeg?w=60" 27 }, 28 { 29 url: "https://images.pexels.com/photos/669006/pexels-photo-669006.jpeg?w=1260", 30 altText: 'two-woman-standing-on-the-ground-and-staring-at-the-mountain', 31 extUrl: 'https://www.pexels.com/photo/two-woman-standing-on-the-ground-and-staring-at-the-mountain-669006/', 32 thumbnailUrl: "https://images.pexels.com/photos/669006/pexels-photo-669006.jpeg?w=60" 33 }, 34 ]; 35 36 constructor(){} 37 38 ngOnInit() {} 39 40 // METHODS 41 // open gallery 42 openGallery(index: number = 0) { 43 this.ngxImageGallery.open(index); 44 } 45 46 // close gallery 47 closeGallery() { 48 this.ngxImageGallery.close(); 49 } 50 51 // set new active(visible) image in gallery 52 newImage(index: number = 0) { 53 this.ngxImageGallery.setActiveImage(index); 54 } 55 56 // next image in gallery 57 nextImage(index: number = 0) { 58 this.ngxImageGallery.next(index); 59 } 60 61 // prev image in gallery 62 prevImage(index: number = 0) { 63 this.ngxImageGallery.prev(index); 64 } 65 66 /**************************************************/ 67 68 // EVENTS 69 // callback on gallery opened 70 galleryOpened(index) { 71 console.info('Gallery opened at index ', index); 72 } 73 74 // callback on gallery closed 75 galleryClosed() { 76 console.info('Gallery closed.'); 77 } 78 79 // callback on gallery image clicked 80 galleryImageClicked(index) { 81 console.info('Gallery image clicked with index ', index); 82 } 83 84 // callback on gallery image changed 85 galleryImageChanged(index) { 86 console.info('Gallery image changed to index ', index); 87 } 88 89 // callback on user clicked delete button 90 deleteImage(index) { 91 console.info('Delete image at index ', index); 92 } 93}
1// gallery configuration 2export interface GALLERY_CONF { 3 imageBorderRadius?: string; // css border radius of image (default 3px) 4 imageOffset?: string; // add gap between image and it's container (default 20px) 5 imagePointer? :boolean; // show a pointer on image, should be true when handling onImageClick event (default false) 6 showDeleteControl?: boolean; // show image delete icon (default false) 7 showCloseControl?: boolean; // show gallery close icon (default true) 8 showExtUrlControl?: boolean; // show image external url icon (default true) 9 showImageTitle?: boolean; // show image title text (default true) 10 showThumbnails?: boolean; // show thumbnails (default true) 11 closeOnEsc?: boolean; // close gallery on `Esc` button press (default true) 12 reactToKeyboard?: boolean; // change image on keyboard arrow press (default true) 13 reactToMouseWheel?: boolean; // change image on mouse wheel scroll (default true) 14 reactToRightClick?: boolean; // disable right click on gallery (default false) 15 thumbnailSize?: number; // thumbnail size (default 30) 16 backdropColor?: string; // gallery backdrop (background) color (default rgba(13,13,14,0.85)) 17 inline?: boolean; // make gallery inline (default false) 18 showArrows?: boolean; // show prev / next arrows (default true) 19} 20 21// gallery image 22export interface GALLERY_IMAGE { 23 url: string; // url of the image 24 thumbnailUrl?: string; // thumbnail url (recommended), if not present, gallery will use `url` property to get thumbnail image. 25 altText?: string; // alt text for image 26 title?: string; // title of the image 27 extUrl?: string; // external url of image 28 extUrlTarget?: string; // external url target e.g. '_blank', '_self' etc. 29}
All properties ending with
?
are optional.
You can make gallery inline like a carousel by setting conf.inline
to true
but make sure to change conf.backdropColor
as well if you need white backdrop color. Also width
and height
of the gallery can be adjusted by manually applying css styles with !important
flag on gallery element.
You can update gallery images images
and gallery configuration conf
anytime you want even when gallery is opened but due to Angular's change detection restrictions you must assign these variable to new value instead of changing internal properties as mentioned below.
1// change images 2this.images = this.images.concat([...]); 3 4// change conf 5this.conf = {...};
npm run demo
http://localhost:4200/
Integrate or build upon it for free in your personal or commercial projects. Don't republish, redistribute or sell "as-is". We would appreciate if you contact us at thatisuday@gmail.com
(if you are a business, institution or organization) so that we can mention your name in users list on this page.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/29 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
license file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
209 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More