Angular2服务器端渲染 - Angular 2通用问题

时间:2017-02-17 10:11:29

标签: node.js angular angular2-routing angular2-universal

我尝试将angular2应用更改为angular2 universal。在那我隔离服务器和客户端模块。在做npm开始时,我收到以下错误。

EXCEPTION: The selector "app-root" did not match any elements
ORIGINAL STACKTRACE:
Error: The selector "app-root" did not match any elements
    at DomRenderer.selectRootElement (C:\Users\SYS168\scotchiversal - Copy\dist\server\index.js:26663:23)
    at selectOrCreateRenderHostElement (C:\Users\SYS168\scotchiversal - Copy\dist\server\index.js:15131:32)
    at AppView._View_AppComponent_Host0.createInternal (/AppModule/AppComponent/host.ngfactory.js:12:16)
    at AppView.create (C:\Users\SYS168\scotchiversal - Copy\dist\server\index.js:51125:21)
    at ComponentFactory.create (C:\Users\SYS168\scotchiversal - Copy\dist\server\index.js:36104:36)
    at ApplicationRef_.bootstrap (C:\Users\SYS168\scotchiversal - Copy\dist\server\index.js:22794:40)
    at C:\Users\SYS168\scotchiversal - Copy\dist\server\index.js:22703:89
    at Array.forEach (native)
    at PlatformRef_._moduleDoBootstrap (C:\Users\SYS168\scotchiversal - Copy\dist\server\index.js:22703:42)
    at C:\Users\SYS168\scotchiversal - Copy\dist\server\index.js:22671:27
你可以请别人帮助我。 这是我的文件夹结构https://s11.postimg.org/g5xht8k6b/git.png

My folder structure

0 个答案:

没有答案