Artem Platonov Artem Platonov - 1 year ago 99
Javascript Question

AngularJS implement element's before method without jQuery

Is there a simple way to implement before method for DOM manipulation without jQuery in my AngularJS directive?

jQuery way is:


Answer Source

To do it without jQuery but with angular's jqLite:

$element.parent()[0].insertBefore($insertedBeforeElement[0], $element[0]);
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download