DEV Community

Discussion on: Why Your Angular App Is Not Working: 7 Common Mistakes

Collapse
 
amineamami profile image
amineamami • Edited

Your actually wrong about #2 , the @ViewChild decorator takes second argument of type { static : boolean, read : TemplateRef | ViewContainerRef | ElementRef } when you have an static element let say div that doesn’t contain any dynamic code inside it ngif/nag-container etc... you can actually access your element even in the constructor if you set static to true, this was a hidden documentation but now its fixed

Collapse
 
valeriopisapia profile image
Valerio

You're right. I will update the article with that information.
Thanks :)