I run my own programming blog called Unicorn Utterances, I do development of all kinds, usually focusing on web development.
I collect retro video games 🎮, like reading 📖, love teaching 👨🏫
The example you linked was not only broken as you pointed out, but the code inside the StackBlitz was outdated compared to the code in the article. It has now been updated to reflect the article properly.
Inside of the helloThereMsg, there is a new scope. Because of this, you cannot access testingMessage outside of that scope, which is why it doesn't render. However, a div does not create a new template scope, and therefore it does render.
Your article is very in depth and thorough. I was always confused by Host View and Embeded View but after the article it made sense. I am sure I have missed some stuff I will be reading it again and bookmarking it.
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.
The example you linked was not only broken as you pointed out, but the code inside the StackBlitz was outdated compared to the code in the article. It has now been updated to reflect the article properly.
To explain why:
Renders the test message but:
Does not is because of the parent scoping.
Inside of the
helloThereMsg
, there is a new scope. Because of this, you cannot accesstestingMessage
outside of that scope, which is why it doesn't render. However, adiv
does not create a new template scope, and therefore it does render.This is similar to the following javascript code:
vs.
thanks for the clarification.
Your article is very in depth and thorough. I was always confused by
Host View
andEmbeded View
but after the article it made sense. I am sure I have missed some stuff I will be reading it again and bookmarking it.