Angular 2:获取谷歌无法正确呈现页面

时间:2017-07-14 06:48:48

标签: angular angular-ui-router

我在 myDomain.com 上运行Angular 2应用程序。默认路线为 / home

在Google控制台中,我运行以Google抓取,结果如下:

  • 获取 myDomain.com - > / home 页面呈现 - 预期结果
  • 获取 myDomain.com/anyRoute - > / home 页面呈现 - 错误结果,我希望 / anyRoute 页面呈现

因此,Google似乎能够阅读并正确呈现我的JavaScript,但在我的应用内部路由时遇到问题。

这是我的路线配置:

export const routes: ModuleWithProviders =

             RouterModule.forRoot(router, 
                     {useHash: false, initialNavigation: false });

我没有使用(我不想要)任何类型的服务器端渲染。

(因为这可能是Angular 2特定的问题(而不是一般SPA问题),我在这里发布它。)

0 个答案:

没有答案