Issue
I am using the $event.currentTarget
to get the element on ng-click
as shown below:
<div ng-click="eventHandler($event)" class="bg-master m-b-10" id="slider-tooltips" nouislider=""></div>
In my controller when in console am getting:
<div ng-click="eventHandler($event)" class="bg-master m-b-10 noUi-target noUi-ltr noUi-horizontal noUi-connect" id="slider-tooltips" nouislider="">
<div class="noUi-base">
<div class="noUi-origin noUi-background" style="left: 9%;">
<div class="noUi-handle noUi-handle-lower">
<div class="tooltip fade top in" style="top: -33px;left: -14px;opacity: 0.7;">
<div class="tooltip-inner">
<span>9.00</span>
</div>
</div>
</div>
</div>
</div>
</div>
I am trying to get the value 9 in the above to show as result. How can I do this in AngularJS?
If this method is wrong, then please let me know the right one.
Solution
I tried below code and i got the result which i was looking for
$scope.eventHandler = function($event){
console.log(parseInt($event.currentTarget.childNodes[0].textContent));
};
Answered By - Raghav
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.