pedroabreu / ion-gallery

Ionic gallery directive
MIT License
124 stars 61 forks source link

configurable template urls #62

Closed synec closed 8 years ago

synec commented 8 years ago

Hi! I've moved the urls for gallery and silder template into ionGalleryConfig to allow use of custom templates.

Hope you like it.

pedroabreu commented 8 years ago

Looks good. Will this mess up with angular template cache if the templates are served differently ? I will have a quick round of testing later before merging.

synec commented 8 years ago

Did you find any problems? Works fine for me! No problems with template cache so far.

pedroabreu commented 8 years ago

I did a small set of tests and no issue at all. Will be merging this 🚢

nmckeown commented 7 years ago

Hi Guys, I'm trying to add a custom button but not having much luck. If I edit the default slider.html, the changes are not reflected in my app. If I change the template_slider config to a different slider file, it does not work. Appreciate any help as would love to use this plug-in but really need get a custom button on the slider. cheers

pedroabreu commented 7 years ago

If you do change the template_slider, you have to rebuild the .min files with gulp. As for this PR, you just need to pass down to the props the template, as explained in the Readme. Any errors in the console ?

nmckeown commented 7 years ago

Thanks Pedro.

On a bit of a learning curve with directives. I have been able to add a button to the slider html.

You need to include the relative path to get this working. For me, it's like the below:

// values for ion gallery
ionGalleryConfigProvider.setGalleryConfig({
                      action_label: 'Close',
                      //template_gallery: 'gallery.html',
                      //template_slider: 'slider.html',
                      template_gallery: '../../assets/lib/ion-gallery/src/templates/tGallery.html',
                      template_slider: '../../assets/lib/ion-gallery/src/templates/tSlider.html',
                      toggle: false,
                      row_size: 3,
                      fixed_row_size: true
});

Example below of adding a button to the end of the slider. I'm having problem getting the padding working on right hand side buts its a start:

This kinda leads me to the next thing, does anyone have example of injecting scope and adding custom function inside this directive. I take any changes to the js files require the .min file to be rebuilt with gulp?