How to control the icon direction when click outside (empty space)?
-fa-angle-up when the user open the dropdown
-fa-angle-down when the user close/default the dropdown
CodePudding user response:
In template you could use blur
listener, so when focus goes away from element (e.g clicking outside) it would turn the flag.
(blur)="menuExpandCategory = !menuExpandCategory"
Forked: https://stackblitz.com/edit/angular-v6heew?file=src/app/app.component.html