Skip to content

gluelabs/ionic-gallery-modal

 
 

Repository files navigation

npm NPM Version NPM Downloads

Glue Labs Logo

Ionic Gallery Modal

It consists of a modal that will help you make gallery preview modal. Last tested with Ionic 3.5.0

Demo

demo-ionic-3-gallery-modal

Example

Installation

Install it using npm

npm install glue-ionic-gallery-modal --save

and then, within your application module

import * as ionicGalleryModal from 'ionic-gallery-modal';
import { HAMMER_GESTURE_CONFIG } from '@angular/platform-browser';

and add the GalleryModalModule to your imports

imports: [
  //...
  ionicGalleryModal.GalleryModalModule,
  //...
],

and to your providers

providers: [
  //...
  {
    provide: HAMMER_GESTURE_CONFIG,
    useClass: ionicGalleryModal.GalleryModalHammerConfig,
  },
  //...
],

Usage

To open the module just use the Ionic ModalController

import { ModalController } from 'ionic-angular';
import { GalleryModal } from 'ionic-gallery-modal';
let modal = this.modalCtrl.create(GalleryModal, {
  photos: photos,
  initialSlide: index
});
modal.present();

Options

The available options are:

{
  photos: Array[{ 
    url: string, 
    type: string,
    description: string
  }],
  closeIcon: string,
  initialSlide: number
}

Problems or suggestions

Let us know or submit a PR! And, please, don't hesitate to contribute. ❤️

Changelog

v0.2.2

  • Add tap to show details and item description

v0.2.1

  • Fixed a bug which caused the production build to not work

v0.2.0

  • Changed to work with Ionic 3.5
  • Added the GalleryModalModule
  • Made it possible to close the modal by swiping down
  • Gallery items can now have title (as a description)

v0.1.0

  • Changed to work with Ionic 3.2
  • Fixed an issue that was causing an error when building ionic app with --prod flag on
  • Changed the whole building system for the plugin

v0.0.7

  • Changed to work with Ionic 2 RC-5
  • Made a temporary fix for orientationchange bug in ios
  • Fixed a problem that was causing apps to not build

Credits

Ciprian Mocanu - @nikini

About

Ionic Gallery Modal (to show all your photos)

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 62.5%
  • JavaScript 24.7%
  • HTML 7.0%
  • CSS 5.8%