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

Function createScript

packages/platform-server/src/transfer_state.ts:40–52  ·  view source on GitHub ↗
(
  doc: Document,
  textContent: string,
  nonce: string | null,
)

Source from the content-addressed store, hash-verified

38
39/** TODO: Move this to a utils folder and convert to use SafeValues. */
40export function createScript(
41 doc: Document,
42 textContent: string,
43 nonce: string | null,
44): HTMLScriptElement {
45 const script = doc.createElement('script');
46 script.textContent = textContent;
47 if (nonce) {
48 script.setAttribute('nonce', nonce);
49 }
50
51 return script;
52}
53
54function warnIfStateTransferHappened(injector: Injector): void {
55 const transferStateStatus = injector.get(TRANSFER_STATE_STATUS);

Callers 2

insertEventRecordScriptFunction · 0.90

Calls 2

createElementMethod · 0.65
setAttributeMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…