Skip to content

gilandose/angular2_photoswipe

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PhotoSwipe for Angular 2+

This is a library with components and services for PhotoSwipe. The official PhotoSwipe JS file is still needed.

installation

npm install --save photoswipe
npm install --save angular2_photoswipe

Include the Angular2PhotoswipeModule.

import {Angular2PhotoswipeModule} from 'angular2_photoswipe';

@NgModule({
  ...
  imports: [
    BrowserModule,
    Angular2PhotoswipeModule.forRoot()
  ]
  ...
})
export class AppModule {
  ...
}

usage

//create gallery
this.ls.createGallery('galleryKey');

//define images
let img = new Image();
img.largeUrl = '/assets/one.jpg';
img.height = 3296;
img.width = 4934;
img.id = 0;
img.size = `${img.width}x${img.height}`;
img.thumbUrl = '/assets/one.jpg';

//add image to gallery
this.ls.addImage('galleryKey', img);

demo

For a complete integration example have a look in the demo folder.

About

An angular2 PhotoSwipe component

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 54.6%
  • JavaScript 40.6%
  • CSS 4.8%