In angular.element
there is only a next()
method but prev()
. Is there any way to simulate the behavior of prev()
with Angular/jqLite only?
You can also use native DOM api to get previous/next sibling:
var prevNode = element[0].previousElementSibling;
var prev = angular.element(prevNode); // optional
var nextNode = element[0].nextElementSibling;
var next = angular.element(nextNode); // optional
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