Showing posts with label photoSwipe. Show all posts
Showing posts with label photoSwipe. Show all posts
Angular PhotoSwipe

Angular PhotoSwipe

May 18, 2017

AngularJS directive for PhotoSwipe. Copyright © 2016, Massimiliano Sartoretto

Installation


You can choose your preferred method of installation:
  • Through bower: bower install ng-photoswipe --save
  • Through npm: npm install ng-photoswipe --save
  • Download from github: angular-photoswipe.min.js


Usage


Inject ngPhotoswipe module in your application with:
 angular  
  .module('myApp', ['ngPhotoswipe'])  
and use the directive as below:
 <div ng-photoswipe  
    slides="slides"  
    slide-selector=".my-awesome-thumbnail"  
    open="isOpen"  
    on-close="onGalleryClose()"  
    template="'./myGallery.template.html'"  
    options="opts"></div>  
where slides is an object defining the images, and the slideSelector is a valid selector to query the gallery images.
The open attribute is a scope boolean that start the gallery when truthy.
The on-close callback will be called after the gallery closes, not surprising.
You can also provide your own template that will override the default one.
(For further infos follow the Official docs)

Note: Special thanks to Massimiliano Sartoretto

Contact - massimilianosartoretto@gmail.com

Disclaimer: The blog is created to share angular directives information to geek, curious Angular Developer.