* Adds the `ng-server-context` attribute to host elements of all bootstrapped components * within a given application.
(applicationRef: ApplicationRef)
| 143 | * within a given application. |
| 144 | */ |
| 145 | function appendServerContextInfo(applicationRef: ApplicationRef) { |
| 146 | const injector = applicationRef.injector; |
| 147 | let serverContext = sanitizeServerContext(injector.get(SERVER_CONTEXT, DEFAULT_SERVER_CONTEXT)); |
| 148 | applicationRef.components.forEach((componentRef) => { |
| 149 | const renderer = componentRef.injector.get(Renderer2); |
| 150 | const element = componentRef.location.nativeElement; |
| 151 | if (element) { |
| 152 | renderer.setAttribute(element, 'ng-server-context', serverContext); |
| 153 | } |
| 154 | }); |
| 155 | } |
| 156 | |
| 157 | function insertEventRecordScript( |
| 158 | appId: string, |
no test coverage detected
searching dependent graphs…