I have a jQuery code:
$('.class i').click(function() {
$(this).parent().find('input').click();
});
Which adds click method to the sibling element when <i> element is clicked.
<div class="class">
<input>
<i>
</div>
What would be the same syntax using Angular?
What I have now is:
<div class="class">
<input>
<i ng-click="onMyClickFunction($event)">
</div>
onMyClickFunction = function(event){
angular.element(event.target).parent().find('input').click();
}
I am using Angular's jqLite. But Angular's jqLite has no click() method. This click() method is a native javascript which is not cross-browser supported plus is not supported on mobile devices.