Hey! Putting aside the fact that manipulating the dom via vanilla js is not an angular way of dealing with things, I also find it wrong to pass function as an input. It would be perfectly fine in the React world, but in Angular you should be emitting close event in the child and binding closeModal to close Output.
If you want to make it even more βAngular-ishβ, I would suggest creating a directive, that would listen to the close event via HostListener and change the class of the host via HostBinding.
Hi Glen, Many thanks for your inputs . I was able to do it by Emitting close event and it worked. I am however trying use the Host Listener as you suggested. I will come back once that is done. Again thanks.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hey! Putting aside the fact that manipulating the dom via vanilla js is not an angular way of dealing with things, I also find it wrong to pass function as an input. It would be perfectly fine in the React world, but in Angular you should be emitting close event in the child and binding closeModal to close Output.
If you want to make it even more βAngular-ishβ, I would suggest creating a directive, that would listen to the close event via HostListener and change the class of the host via HostBinding.
Hi Glen, Many thanks for your inputs . I was able to do it by Emitting close event and it worked. I am however trying use the Host Listener as you suggested. I will come back once that is done. Again thanks.