How do I get DOM
element Attributes
similar way (outside angular) I get $scope
(angular.element(element).scope())
?
I need this so I can use $animator
service on some element that is being inserted into DOM
the part of my code would look like:
var element = $compile(template,scope);
var attrs = ? // I would do element.attrs(),
// but this won't work as it does not perform normalization
var animation = $animator(scope,attrs);
animation.enter(element,parent);
this worked for me so you'll just need to know the attributes you're looking for...
console.log( angular.element(element)[0].getAttribute('class') );
actually this should then work too:
var attrs = angular.element(element)[0].attributes;
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