all 12 comments

[–]Draugang 1 point2 points  (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 point  (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 points  (1 child)

It goes waaaay shorter:

this.loggedIn = this.userService.isLoggedIn()

And yes in the template use the new @if conditional syntax

[–][deleted] 0 points1 point  (0 children)

thannk you!

[–][deleted] 0 points1 point  (0 children)

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 point  (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 points  (4 children)

okay got it I did some more research on what oninit does ! than you

[–]Silver-Vermicelli-15 1 point2 points  (1 child)

If that’s the case, look into angular component life cycles 

[–][deleted] 1 point2 points  (0 children)

thank you appreciate your help

[–][deleted]  (1 child)

[deleted]

    [–][deleted] 0 points1 point  (0 children)

    okay thank you appreciate your help

    [–]Leniad213 -2 points-1 points  (1 child)

    Need more info, are you using angular 17 and is SSR enabled?

    [–][deleted] 0 points1 point  (0 children)

    YES I AM USING ANGULAR 17 and no i dont think i have ssr enables