ng-click or alternative in jquery

0

I need to click the thumb image to write the image clicked on the div .currentImage

  

Script

    .directive('galeria',function() {
return {
    templateUrl:'scripts/directives/galeria/galeria.html',
    restrict: 'E',
    scope:{
        'pasta':'@',
        'restrito':'@',
    },
    controller: function($scope,$http){
        // INICIAR CAROUSEL DA HOME 
        $(".thumbsGaleria").owlCarousel({
            autoPlay:true,
            jsonPath: "api/galeria.php?id="+$scope.pasta,
            jsonSuccess: customDataSucesso,
            afterAction: afterFunction
        })
        function customDataSucesso(data){
            var content = "";
            for(var i in data){
                   var img = data[i];
                content += '<img src="painel/modulos/galerias/pastas/'+$scope.pasta+'/'+img+'" ng-click="currentClick('+img+')" style="width:100%; padding-right:10px; max-height:415px">'
             }
            $(".thumbsGaleria").html(content);
        }
        // FIM CAROUSEL

        function afterFunction(elem){
            var current = this.currentItem;
            var src = elem.find(".owl-item").eq(current).find("img").attr('src');
            $(".currentImage").html("<img src='"+src+"' >");
        }

        $scope.currentClick = function(imgCurrent){
            $(".currentImage").html("<img src='"+imgCurrent+"' >");
        }

    }
}  });
  

HTML

<section class="section box" >
<div class="thumbsGaleria"></div>

<div class="currentImage">
</div>

But the NG-CLICK does not work, when clicking on the item, nothing happens. I tried putting an ONCLICK when clicking the console returns that the specified function does not exist.

    
asked by anonymous 08.08.2016 / 21:09

1 answer

0

SOLVED PROBLEM

Replace $ scope.currentClick with the script below.

        $(".thumbsGaleria").on("click", ".owl-item", function(e){
            var imagem = $(this).find('img').attr('src');
            $(".currentImage").html("<img src='"+imagem+"' >");
        });

Thank you to those who paid attention.

    
10.08.2016 / 16:53