3
我玩角度通用的一点,但无法找到选择使用服务器端渲染仅适用于像主页这样的一些页面,并以标准角度方式呈现所有其他路线。我不想使用服务器端渲染专用页面,而不需要SEO。我可以这样仅适用于某些路线的角度通用渲染
// send all requests to Angular Universal
// if you want Express to handle certain routes (ex. for an API) make sure you adjust this
app.get('/', ngApp);
app.get('/home', ngApp);
app.get('/about', ngApp);
配置快速线路理想我不想知道在的NodeJS和所有角上配置路由财产像服务器端进行配置:真实
const appRoutes: Routes = [
//public route, I want server rendering for SEO
{ path: 'home', component: HomeComponent, serverSide: true },
//private user profile page, SEO is not needed
{ path: 'user/profile/:id', component: UserProfileComponent },
];