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.