Get the current Element from angularjs, (like this in javascript)

0

I need to obtain the current element, to be able to manipulate the elements that surround it, but I do not know if that is possible with angularjs, as well as in jQuery that we can manipulate the DOM. Please if someone can help me.

    
asked by Nancy Zj 12.10.2017 в 20:56
source

1 answer

0

I have captured this in angular as follows:

<button ng-click="capturar($event)">capturar</button>

$scope.capturar = function($event){
    angular.element($event.toElement).parent();
}

angular.element = works as $ of jQuery

$event.toElement = works as this

I hope you serve, greetings!

    
answered by 13.10.2017 / 18:22
source