简体   繁体   English

带有角度和节点的服务器端渲染

[英]Server Side Rendering with Angular and Node

I was using the server side rendering concept in Angular for UI and Server is on Node.js. 我在Angular中为UI使用服务器端渲染概念,而Server在Node.js上。 So what I was doing is rendering the HTML Part when I hit API from Angular Component and that rendered part is shown on the Screen. 因此,当我从Angular Component中访问API时,我正在渲染HTML部件,并且该渲染的部件显示在屏幕上。

Now the Problem is their are some anchor TAGS with href 现在的问题是它们是带有href的一些锚标记

example- href='/dashboard/cop/batting' HTML rendered from API. example- href='/dashboard/cop/batting'从API呈现href='/dashboard/cop/batting' HTML。

Now when I click this link my whole angular application RESTARTS and from app.module.ts then sets routing. 现在,当我单击此链接时,整个角度应用程序将重新启动并从app.module.ts中进行设置。

This takes and lots of time and disturb my APP flow. 这将花费大量时间,并打扰了我的APP流程。

I have also tried href='/#/dashboard/cop/batting' which i was get from this Article 我也曾尝试href='/#/dashboard/cop/batting'我是从这个获得

What i want is to RESTART the whole application just Stay on that respective component and do the WORK. 我要重新启动整个应用程序,只需停留在相应的组件上并执行工作即可。

使用href创建的此问题将重新加载您应使用[routerLink]指令进行路由更改的页面

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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