Created
January 24, 2018 18:18
-
-
Save xola139/dd2aca9043e055df3d26e7f1cb6e1f1f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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