I have the following problem, I have created the following directive:
appController.directive('erCustomerror', function() {
return {
restrict: 'E',
scope: {
clickOn: '&',
textoVariable: '=texto'
},
template: '<li><strong>{{textoVariable}}</strong></li>' +
'<p class="error-server">' +
'<strong>Upps!</strong><br>' +
'Tuvimos un problema<br>Vuelve a intentarlo<br>' +
'<a href="" ><img src="img/icon-actualizar.png" width="24" ng-click="clickOn()"></a>' +
'</p>'
};
})
and in the html it is declared in the following way:
<div class="lista-col" ng-show="ocultarErrorPost">
<er-Customerror texto="valorDirectivePost" clickOn="refreshPortlet()"></er-Customerror>
</div>
and in the controller I have the following $scope.refreshPortlet
that I want to execute when I click to update the image as it is in the example.
My controller goes like this
appController.controller('myCtrl',function($scope,$http){
$scope.refreshPortlet = function(){
console.log("Haz Algo");
}
});
Please someone who can help me, because I think I suppose I'm doing well, or I do not know what I'm doing wrong. thanks in advance