简体   繁体   中英

Angular universal rendering issue

I have an issue via Angular universal. When I do the first request (http://localhost:4200) I've got the Home page, but when I'm trying to get another page (http://localhost:4200/account) I've got the Home page to, after that my app render correct component but I need to get correct page on the first request, what I'm missing?

(Angular Universal don't render routes) Angular 10, Angular-universal (nodejs, express.js) - 10

Solved by fixing CanActivate in the routing config By default, I use localStorage for saving auth info, if I have not info about auth in the localStorage navigate to the home page, the server always navigates to the home page but in the browser, I have that info

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM