How to use the @nguniversal/aspnetcore-engine.createTransferScript function in @nguniversal/aspnetcore-engine

To help you get started, we’ve selected a few @nguniversal/aspnetcore-engine examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github TrilonIO / aspnetcore-angular-universal / ClientApp / boot.server.ts View on Github external
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
    });
  });
});
github TrilonIO / aspnetcore-angular-universal / ClientApp / boot.server.PRODUCTION.ts View on Github external
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
    };
  });
});
github Swastika-IO / sio.core / src / Swastika.IO.Core / ClientApp / boot.server.ts View on Github external
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
    });
  });
});

@nguniversal/aspnetcore-engine

ASP.NET Core Engine for running Server Angular Apps

MIT
Latest version published 3 years ago

Package Health Score

59 / 100
Full package analysis