Angular - How to trigger a div located in other commponent and triggering from another component?

Angular - How to trigger a div located in other commponent and triggering from another component?
0

#1

What if trigger a div located in other commponent and triggering from another component?
child.component.html

<div  class="child" > child </  div>   

app.component.ts

$('.child').trigger('click');  

want to achieve same functionality as jquery code and remove jquery code


How to trigger a click event on child element got as result when using querySelector on native element in angular2/angular4
#2

I moved your question from the other thread, because your reply was about your own code question(s). In the future, please start your own thread, so it has it’s own replies.

Also, I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make easier to read.

See this post to find the backtick on your keyboard. The “preformatted text” tool in the editor (</>) will also add backticks around text.

Note: Backticks are not single quotes.

Thank you.


#3

Thank you for moving my question as new thread.