S
S
Sergey2015-10-29 12:51:51
Angular
Sergey, 2015-10-29 12:51:51

Angular - how to create a trigger like in jquery (tutorial)?

have a skeleton

<ul>
                    <li ng-repeat="social in media" 
                        ng-mouseover="showWeb=false" 
                        ng-mouseleave="showWeb=true" 
                        ng-click="clickToLink()">
                        <a href="{{social.link}}" class="sprite {{social.class}}">Мы в {{social.name}}</a>
                        <span class="showWeb" ng-hide="showWeb">{{social.name}}</span> 
                    </li>
                </ul>

How to pass the this value to ng-click and then in the clickToLink function make the click event on the nested tag a
$(this).find('a').trigger('click');

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Nicholas, 2015-10-29
@Sergamers

Why do you need this behavior? If you need to follow a link, you can do it through the $location service, for example.

R
rakro, 2015-10-29
@rakro

clickToLink(social) is not what you need?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question