MCPcopy Index your code
hub / github.com/angular/angular / setupTransferState

Function setupTransferState

modules/benchmarks/src/hydration/table.ts:56–65  ·  view source on GitHub ↗
(cols: string, rows: string)

Source from the content-addressed store, hash-verified

54}
55
56export function setupTransferState(cols: string, rows: string) {
57 const script = document.createElement('script');
58 script.id = 'ng-state';
59 script.type = 'application/json';
60 // This script contains hydration annotation for the `TableComponent` component.
61 // Note: if you change the `TableComponent` template, make sure to update this
62 // annotation as well.
63 script.textContent = `{"__nghData__":[{"t":{"3":"t0"},"c":{"3":[{"i":"t0","r":1,"t":{"2":"t1"},"c":{"2":[{"i":"t1","r":1,"x":${cols}}]},"x":${rows}}]}}]}`;
64 document.body.insertBefore(script, document.body.firstChild);
65}

Callers 1

main.tsFile · 0.90

Calls 2

createElementMethod · 0.65
insertBeforeMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…