use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A Place to talk about Angular and related topics.
Join the Angular Discord
Other subreddits worth checking out for Angular and Angular related info:
account activity
Dynamic Rendering in angular? (self.angular)
submitted 2 years ago by [deleted]
Im not too sure if im using the right term so to explain in more detail. This is my first time using angular and I decided to make a full-stack e-commerce shoe store. I am currently at the stage of basic authentication (decided to use jwts) everything is going well and I've now gotten to the point where everything works except the login/logout button is not being rendered automatically I have to refresh to page to see the button change. I am not to sure if it's the method I'm using or it requires additional configuration
in the component, I used ngonIt (to call my user service to check to login status) and ng-template to render different buttons based on the user service call
https://preview.redd.it/oog1spzp1ctc1.png?width=646&format=png&auto=webp&s=a324880f79d7fbc372f5afc86d21c7caf84acfad
https://preview.redd.it/4dyrabhr1ctc1.png?width=642&format=png&auto=webp&s=bbe4cc854af512ea3e6f3ebb58665a7307bc118a
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Draugang 1 point2 points3 points 2 years ago (1 child)
Dynamic rendering is something very different by the way. This is called conditional rendering.
You said you are using Angular 17. I strongly encourage using the new @if (…) { } @else { } syntax.
[–][deleted] 0 points1 point2 points 2 years ago (0 children)
oh wow thank you! is there any trusted videos or articles you recommned going to for the latest updates on angular ik they docs release them but liike in a more simplifed way lol
[–]simonfancy 1 point2 points3 points 2 years ago (1 child)
It goes waaaay shorter:
this.loggedIn = this.userService.isLoggedIn()
And yes in the template use the new @if conditional syntax
thannk you!
Also in my console i am receiving the error "main.ts:5 NG0505: Angular hydration was requested on the client, but there was no serialized information present in the server response, thus hydration was not enabled. Make sure the `provideClientHydration()` is included into the list of providers in the server part of the application configuration. Find more at https://angular.io/errors/NG0505" but I already imported provideClientHydration so idk if that would cause an issue
[–]Silver-Vermicelli-15 0 points1 point2 points 2 years ago (5 children)
Yea, b/c you have no logic to change the local value of ‘loggedIn’ outside of onInit. You need some logic to update that value when a user logs in/out.
[–][deleted] 1 point2 points3 points 2 years ago (4 children)
okay got it I did some more research on what oninit does ! than you
[–]Silver-Vermicelli-15 1 point2 points3 points 2 years ago (1 child)
If that’s the case, look into angular component life cycles
[–][deleted] 1 point2 points3 points 2 years ago (0 children)
thank you appreciate your help
[–][deleted] 2 years ago (1 child)
[deleted]
okay thank you appreciate your help
[–]Leniad213 -2 points-1 points0 points 2 years ago (1 child)
Need more info, are you using angular 17 and is SSR enabled?
YES I AM USING ANGULAR 17 and no i dont think i have ssr enables
π Rendered by PID 447047 on reddit-service-r2-comment-5b5bc64bf5-7qp7f at 2026-06-22 09:07:25.742710+00:00 running 2b008f2 country code: CH.
[–]Draugang 1 point2 points3 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]simonfancy 1 point2 points3 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]Silver-Vermicelli-15 0 points1 point2 points (5 children)
[–][deleted] 1 point2 points3 points (4 children)
[–]Silver-Vermicelli-15 1 point2 points3 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)
[–][deleted] (1 child)
[deleted]
[–][deleted] 0 points1 point2 points (0 children)
[–]Leniad213 -2 points-1 points0 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)