Szymon Standarski
banner
standarski.bsky.social
Szymon Standarski
@standarski.bsky.social
Mostly a frontend developer 👨🏻‍💻 (Angular, React.js), but I also have experience with Node.js. In my free time, I’m an amateur cyclist 🚴🏻‍♂️.
If you want to avoid the "No provider for HostAttributeToken..." error when this parameter is not provided, simply mark it as optional and provide an alternative value:

color: string = inject(new HostAttributeToken('color'), { optional: true }) || 'black';

Example -> standarski.short.gy/aq4FeT
HostAttributeToken - StackBlitz
Example HostAttributeToken
standarski.short.gy
July 25, 2025 at 10:55 AM
Cool. I checked it out and it solves the problem I had. Thanks!
February 28, 2025 at 1:26 PM
Very nice. I will also share mine:
February 3, 2025 at 11:13 AM
It may seem like a weird JavaScript oddity, but it’s actually a powerful feature!
Imagine your code needs to alert the user when two sensors return different values. If both sensors fail and produce faulty data, leading to NaN, the comparison NaN !== NaN triggers the alert—exactly as intended! 🚨
January 16, 2025 at 2:55 PM