Example of using asp-prerender-data to get server-supplied data to both server and client JS

This commit is contained in:
Steve Sanderson
2017-05-22 10:25:08 +01:00
parent ad645cbfe9
commit 678e230021
5 changed files with 17 additions and 5 deletions

View File

@@ -14,7 +14,8 @@ import { sharedConfig } from './app.module.shared';
...sharedConfig.imports
],
providers: [
{ provide: 'ORIGIN_URL', useValue: location.origin }
{ provide: 'ORIGIN_URL', useValue: location.origin },
{ provide: 'PRERENDERING_DATA', useValue: (window as any).PRERENDERING_DATA }
]
})
export class AppModule {