maximelafarie / ngx-smart-modal

Modal/Dialog component crafted for Angular (Ivy-compatible)
https://maximelafarie.com/ngx-smart-modal/
MIT License
323 stars 87 forks source link

document.getElementsByTagName return 0 when component added inside ngx-smart-modal #327

Closed tsctrl closed 3 years ago

tsctrl commented 3 years ago

I'm submitting a ... (check one with "x")

[ x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, post on Stackoverflow or Gitter

Current behavior

add angular app-comp component inside ngx-smart-modal

query the angular element using inside parent component that handling smart modal in ngInit/ngAfterViewInit: const el: HTMLCollectionOf = document.getElementsByTagName(app-comp); console.log(el.length);

result: 0

Expected behavior

result: 1

Reproduction of the problem

What is the motivation / use case for changing the behavior?

Please tell us about your environment:

Angular 9 . VS studio, "ngx-smart-modal": "^7.4.1"

tsctrl commented 3 years ago

solve by late init the component, thanks!