Hi Cool,
As @saurabh has shown how to use the jqLitepart, and I will show how to do
it using native JS this is whole well possible.
However, I wanted to give you a waring. This style of programming makes it
very easy to store date and/or state inside your DOM. While this might be
working OK, it will cause hard to diagnose and to reason about code. making
maintenance more difficult as it needs to be. Why read the data back out
the dom, if you have it already in your model?
.directive("getChildren", function() {
return {
restrict: "A",
link: function(scope, element, attrs) {
let el = element[0] //loose the JQ wrapper
el.addEventListener("click", function() {
el.querySelectorAll('li').forEach(function(child) {
alert(child.getAttribute("id"));
})
});
}
}
})
that's also a solution to your issue.
Regards
Sander
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.