pedroabreu / ion-gallery

Ionic gallery directive
MIT License
124 stars 61 forks source link

TemplateUrl is static(?) #79

Closed tsirlucas closed 7 years ago

tsirlucas commented 7 years ago

I've tried to change the slider template via provider and the html hasn't changed, so i went to ion-gallery.js to check what was happening and the loadModal function isn't getting the template from provider.

My provider config:

angular
  .module('test')
  .config(galleryConfig);

function galleryConfig(ionGalleryConfigProvider) {
  ionGalleryConfigProvider.setGalleryConfig({
    action_label: 'Close',
    template_slider: './components/photoWall/photoWallModal.view.html'
  });
}

The loadModal function on :

scope.loadModal = function(){
        $ionicModal.fromTemplateUrl('slider.html', {
          scope: scope,
          animation: 'fade-in'
        }).then(function(modal) {
          _modal = modal;
          scope.openModal();
        });
      };

Is it right or am I doing something wrong? I've made the corrections by hacking the lib and the loadModal function went like that:

scope.loadModal = function(){
        $ionicModal.fromTemplateUrl(ionGalleryConfig.template_slider || 'slider.html', {
          scope: scope,
          animation: 'fade-in'
        }).then(function(modal) {
          _modal = modal;
          scope.openModal();
        });
      };

It's kinda simple to fix if I'm right, so I'm stepping up to create a PR.

tsirlucas commented 7 years ago

Oh, i just cloned your project and notice that it's already fixed on master branch. Last version on bower is not working right.