Security News
The Push to Ban Ransom Payments Is Gaining Momentum
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
angular2-image-popup
Advanced tools
Readme
The sources for this package are in (https://github.com/vimalavinisha/angular2-image-popup) repo. Please file issues and pull requests against this repo.
##Usage node install npm install angular2-image-popup bower install bower install image-popup ###1.In index.html page include following css ###2.component file use like below import {Component} from 'angular2/core'; import {ImageModal} from '../directives/angular2-image-popup/image-modal-popup'; @Component({ selector : 'my-app', directives: [ImageModal], template: `
you can directly access "ImageModel" directive for both listing thumbnails and popup images
<ImageModal [modalImages]="images"></ImageModal>
<h2> Example with thumbnail pointers </h2>
<p> you can list images in your file and then calling "ImageModel" directive to show images on popup only</p>
<div *ngFor="let img of images; let i= index">
<div class="float-left" *ngIf="i <= 2" >
<a class="more" *ngIf="i==2" (click)="OpenImageModel(img.img,images)"> +{{images.length - 3}} more </a>
<img class="list-img" src="{{img.thumb}}"(click)="OpenImageModel(img.img,images)" alt='Image' />
</div>
</div>
<div *ngIf="openModalWindow">
<ImageModal [modalImages]="images" [imagePointer] = "imagePointer" (cancelEvent) ="cancelImageModel()"></ImageModal>
</div>
`
})
export class AppComponent {
openModalWindow:boolean=false;
imagePointer:number;
images = [
{ thumb: './app/assets/images/gallery/thumbs/img1.jpg', img: './app/assets/images/gallery/img1.jpg', description: 'Image 1' },
{ thumb: './app/assets/images/gallery/thumbs/img2.jpg', img: './app/assets/images/gallery/img2.jpg', description: 'Image 2' },
{ thumb: './app/assets/images/gallery/thumbs/img3.jpg', img: './app/assets/images/gallery/img3.jpg', description: 'Image 3' },
{ thumb: './app/assets/images/gallery/thumbs/img4.jpg', img: './app/assets/images/gallery/img4.jpg', description: 'Image 4' },
{ thumb: './app/assets/images/gallery/thumbs/img5.jpg', img: './app/assets/images/gallery/img5.jpg', description: 'Image 5' }
];
constructor() {
}
OpenImageModel(imageSrc,images) {
//alert('OpenImages');
var imageModalPointer;
for (var i = 0; i < images.length; i++) {
if (imageSrc === images[i].img) {
imageModalPointer = i;
console.log('jhhl',i);
break;
}
}
this.openModalWindow = true;
this.images = images;
this.imagePointer = imageModalPointer;
}
cancelImageModel() {
this.openModalWindow = false;
}
}
FAQs
Image popup directive for angular2
The npm package angular2-image-popup receives a total of 3 weekly downloads. As such, angular2-image-popup popularity was classified as not popular.
We found that angular2-image-popup 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
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
Application Security
New SEC disclosure rules aim to enforce timely cyber incident reporting, but fear of job loss and inadequate resources lead to significant underreporting.
Security News
The Python Software Foundation has secured a 5-year sponsorship from Fastly that supports PSF's activities and events, most notably the security and reliability of the Python Package Index (PyPI).