3
votes

I am working on an asp.net core 2.0 mvc with angular project. I have created a fresh project from official template;

I can see 2 files in ClientApp subfolder and i do not understand the differences between those 2 files:

app.shared.module.ts
app.server.module.ts

Thanks

1

1 Answers

1
votes

Check out this answer, as I believe it applies to you:

The ASP.NET Core SPA with Angular 4 template splits the AppModule into three files so that Webpack will be able to efficiently compile the client-side bundle (suitable for running in browsers) and the server-side prerendering bundle (meant for running in Node).

More specifically, such approach expects that:

  • browser-specific modules and providers will be put in the app.module.browser.ts file.
  • server-specific modules and providers will be put in the app.module.server.ts file.
  • anything needed regardless of the executing context will be put in the app.module.shared.ts file.