Skip to content

Instantly share code, notes, and snippets.

@xola139
Created January 24, 2018 18:18
Show Gist options
  • Select an option

  • Save xola139/dd2aca9043e055df3d26e7f1cb6e1f1f to your computer and use it in GitHub Desktop.

Select an option

Save xola139/dd2aca9043e055df3d26e7f1cb6e1f1f to your computer and use it in GitHub Desktop.
angular.module('myModuleApp').directive('itemProducto', function() {
return{
restrict: 'E',
scope: {
item: '=',
pathimage: '@',
urldisable: '@'
},
templateUrl: 'someTemplate.html',
link : function(scope, element, attrs){
//Add event listener for 'click' event
element.on('click', function(event) {
});
console.log( element);
}
}
});
//Implement in html
<item-producto item="someJSON" urldisable="true" pathimage="some/url/image.png"/>"></item-producto>
// in someTemplate.html
<div class="id_{{item.someId}}"></div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment