A
A
Alexey Aristov2016-05-06 23:56:37
Angular
Alexey Aristov, 2016-05-06 23:56:37

Is it possible to restore a reference to the object whose data was used through HTMLElement?

There is a div:

<div id='vendor-source' class="col-md-4 vendor-bag" potential-vendors></div>

with the help of .directive divs like this are displayed inside it:
<div class="vendorBlock {{vendor.selected}}" ng-repeat="vendor in vendors">{{vendor.name}}</div>

On some event (drag'n'drop) I have a link (HTMLElement) to one of the nested divs. I need to mark the corresponding vendor-a selected.
Is it possible to restore the reference to the vendor object through HTMLElement? (How?)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Aristov, 2016-05-07
@aristov

Found a solution. Link to vendor-a:
angular.element(el).scope().vendor

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question