You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which @angular/* package(s) are the source of the bug?
Don't known / other
Is this a regression?
Yes
Description
Hi there!
I found strange behavior with components name, or maybe it is normal behavior but and my knowledge about angular is not enough but...
I'm creating some single page website using angular 17 and I had to to create policy views for privacy policy and cookies policy. I created PrivacyPolicyComponent and after that I just simply copied it to use it as CookiesPolicyComponent (of course I changed name everywhere). After all needed changes I just simply added it to module routing so my two routes for policies looked like this:
I checked my https://localhost:4200/privacy-policy url and it worked fine but https://localhost:4200/cookies-policy didn't, so I started looking for problems. I simply opened dev tools to inspect if there are some console errors but there were none. I decided to check DOM if component is there and I found it but when I hoovered it there was nothing to look at (standard tooltip with dimensions were not displayed) in my viewport and I noticed some strange user agent stylesheet added: display: none !important;. After that I added some simple console logs in ngOnInit and in constructor but nothing happened and I couldn't see it in console.
After some debugging I thought that I did some spelling mistake or something strange happened so I decided to just simply generate new component so I did it with Angular CLI and I added it in module routing to my cookies-policy route but... nothing has changed and I still couldn't see my component beeing rendered on my route.
I decided to do some more debugging and I just simply changed places of routes in array etc but still nothing helped to fix it, and then I just used the same component for both routes like this:
...and it worked, so my conclusion was: "Ok, routing works fine so why the heck my newly generated component don't work?".
I don't know why but I decided to generate a few components with 'cookie' in name like: CookiesComponent, CookiesPolicyComponent, CookieComponent, CookiePolicyComponent and none of these worked, but when I generated component with some random name like BlahBlahComponent then it worked fine.
I also checked it with rendering component with "cookie" in name directly in html file like <app-cookie></app-cookie> and there is still the same problem - component is not rendered.
So, my question is: is this feature or bug? And if it is a feature then why?
Please provide a link to a minimal reproduction of the bug
No response
Please provide the exception or error you saw
None
Please provide the environment you discovered this bug in (run ng version)
Angular doesn't provide default styles, and cookies-policy being hidden using a style suggests the work of an adblocker. I'd suggest opening the page in incognito mode (where extensions are typically disabled).
Which @angular/* package(s) are the source of the bug?
Don't known / other
Is this a regression?
Yes
Description
Hi there!
I found strange behavior with components name, or maybe it is normal behavior but and my knowledge about angular is not enough but...
I'm creating some single page website using angular 17 and I had to to create policy views for privacy policy and cookies policy. I created
PrivacyPolicyComponent
and after that I just simply copied it to use it asCookiesPolicyComponent
(of course I changed name everywhere). After all needed changes I just simply added it to module routing so my two routes for policies looked like this:I checked my
https://localhost:4200/privacy-policy
url and it worked fine buthttps://localhost:4200/cookies-policy
didn't, so I started looking for problems. I simply opened dev tools to inspect if there are some console errors but there were none. I decided to check DOM if component is there and I found it but when I hoovered it there was nothing to look at (standard tooltip with dimensions were not displayed) in my viewport and I noticed some strange user agent stylesheet added:display: none !important;
. After that I added some simple console logs inngOnInit
and in constructor but nothing happened and I couldn't see it in console.After some debugging I thought that I did some spelling mistake or something strange happened so I decided to just simply generate new component so I did it with Angular CLI and I added it in module routing to my
cookies-policy
route but... nothing has changed and I still couldn't see my component beeing rendered on my route.I decided to do some more debugging and I just simply changed places of routes in array etc but still nothing helped to fix it, and then I just used the same component for both routes like this:
...and it worked, so my conclusion was: "Ok, routing works fine so why the heck my newly generated component don't work?".
I don't know why but I decided to generate a few components with 'cookie' in name like:
CookiesComponent, CookiesPolicyComponent, CookieComponent, CookiePolicyComponent
and none of these worked, but when I generated component with some random name likeBlahBlahComponent
then it worked fine.I also checked it with rendering component with "cookie" in name directly in html file like
<app-cookie></app-cookie>
and there is still the same problem - component is not rendered.So, my question is: is this feature or bug? And if it is a feature then why?
Please provide a link to a minimal reproduction of the bug
No response
Please provide the exception or error you saw
Please provide the environment you discovered this bug in (run
ng version
)Anything else?
No response
The text was updated successfully, but these errors were encountered: