Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export default createServerRenderer((params) => {
// Platform-server provider configuration
const setupOptions: IEngineOptions = {
appSelector: '',
ngModule: AppModule,
request: params,
providers: [
// Optional - Any other Server providers you want to pass
// (remember you'll have to provide them for the Browser as well)
]
};
return ngAspnetCoreEngine(setupOptions).then(response => {
// Apply your transferData to response.globals
response.globals.transferData = createTransferScript({
someData: 'Transfer this to the client on the window.TRANSFER_CACHE {} object',
fromDotnet: params.data.thisCameFromDotNET // example of data coming from dotnet, in HomeController
});
return ({
html: response.html, // our serialized
globals: response.globals // all of our styles/scripts/meta-tags/link-tags for aspnet to serve up
});
});
});
export default createServerRenderer((params) => {
// Platform-server provider configuration
const setupOptions: IEngineOptions = {
appSelector: '',
ngModule: AppModule,
request: params,
providers: [
// Optional - Any other Server providers you want to pass
// (remember you'll have to provide them for the Browser as well)
]
};
return ngAspnetCoreEngine(setupOptions).then(response => {
// Apply your transferData to response.globals
response.globals.transferData = createTransferScript({
someData: 'Transfer this to the client on the window.TRANSFER_CACHE {} object',
fromDotnet: params.data.thisCameFromDotNET // example of data coming from dotnet, in HomeController
});
return ({
html: response.html, // our serialized
globals: response.globals // all of our styles/scripts/meta-tags/link-tags for aspnet to serve up
});
});
});
export default createServerRenderer(params => {
// Platform-server provider configuration
const setupOptions: IEngineOptions = {
appSelector: '',
ngModule: AppModuleNgFactory,
request: params,
providers: [
// Optional - Any other Server providers you want to pass
// (remember you'll have to provide them for the Browser as well)
]
};
return ngAspnetCoreEngine(setupOptions).then(response => {
// Apply your transferData to response.globals
response.globals.transferData = createTransferScript({
someData:
'Transfer this to the client on the window.TRANSFER_CACHE {} object',
fromDotnet: params.data.thisCameFromDotNET // example of data coming from dotnet, in HomeController
});
return {
html: response.html, // our serialized
globals: response.globals // all of our styles/scripts/meta-tags/link-tags for aspnet to serve up
};
});
});