Answer the question
In order to leave comments, you need to log in
Angular 2 click outside of component?
I have two components, parent and child. On the parent there is a form with inputs, under the input there is a child component, something like an autocomplete to the input. I need to open and close this dropdown by clicking on the input. There are no problems with this. But you also need to close the input when clicking outside the dropdown. And here is the problem, a click on the input is already considered a click outside the dropdown and the dropdown does not open. How to get around this problem? (I don't think this is a problem though, and Anguar 2 has solutions for that)
Not a great plunker example: https://plnkr.co/edit/0Y1VtQ9CPoBB9kfsE8XG?p=preview
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question