ASP.NET CORE 2 + ANGULAR 4:NodeInvocationException:由于错误导致预渲染失败:ReferenceError:未定义窗口

Gma*_*hew 12 asp.net web asp.net-core-2.0 angular

我正在尝试使用ngx-chips进行标记输入,但是我在导入BrowserAnimationsModule时遇到了这个问题.

在导入BrowserAnimationsModule时,我收到以下错误:

An unhandled exception occurred while processing the request.

NodeInvocationException: document is not defined
ReferenceError: document is not defined
Run Code Online (Sandbox Code Playgroud)

一旦我在app.module.shared.ts下的导入中评论BrowserAnimationsModule,我的应用程序正常工作但是一旦我取消注释它,我就会出现同样的错误.

请问我怎么能把它丢弃,我已经为此工作了4天以上.或者建议我使用ASP.NET Core 2 SPA模板的任何其他角度4标签输入库.

谢谢...

Wil*_*ill 18

在你看来的(Index.cshtml)的应用程序标签,更换asp-prerender-moduleasp-ng2-prerender-module.

  • 是asp-ng2-prerender-module一个新关键字,还是您的“解决方案”只是禁用了SSR? (2认同)