Jsfiddle is here.
Inside my directive's linking function, i am trying to print the directive element's tag name as,
myApp.directive('myDirective', function () {
return {
link: function (scope, element, attrs) {
element.append('<hr>you know, my tag name is ' + element.tagName)
}
}
})
It prints undefined whereas i expect the directive's tag name my-directive to be printed.
You should use this element[0].tagName
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With